-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
22bcc0e
commit 243d1df
Showing
71 changed files
with
2,773 additions
and
4,409 deletions.
There are no files selected for viewing
2 changes: 1 addition & 1 deletion
2
.../Waypoints/Scripts/Runtime/Waypoints.meta → .../Scripts/Runtime/RMC/Core/Components.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
...TS/3rdParty/RMC/RMC Core/RMC Core/Scripts/Runtime/RMC/Core/Components/HierarchyDivider.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
using UnityEngine; | ||
|
||
namespace RMC.Components | ||
{ | ||
public class HierarchyDivider : MonoBehaviour | ||
{ | ||
protected virtual string Title | ||
{ | ||
get { return "Title"; } | ||
} | ||
|
||
protected virtual void OnValidate() | ||
{ | ||
if (Application.isPlaying) | ||
{ | ||
return; | ||
} | ||
|
||
var newTitle = CenterTitle(Title, 30); | ||
if (gameObject.name != newTitle) | ||
{ | ||
gameObject.name = newTitle; | ||
} | ||
} | ||
|
||
private static string CenterTitle(string title, int length) | ||
{ | ||
title = " " + title + " "; | ||
int totalPadding = length - title.Length; | ||
int leftPadding = totalPadding / 2; | ||
int rightPadding = totalPadding - leftPadding; | ||
|
||
string result = new string('-', leftPadding) + title + new string('-', rightPadding); | ||
|
||
return result; | ||
} | ||
} | ||
} |
11 changes: 11 additions & 0 deletions
11
...dParty/RMC/RMC Core/RMC Core/Scripts/Runtime/RMC/Core/Components/HierarchyDivider.cs.meta
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.