Editor Helpers
Readable object labels for your own editor windows — without “(Script)”, and numbered for identical components.
Quick start
| Before — Unity API | After — FastTools |
|---|---|
| |
GetDisplayName()
Works on any UnityEngine.Object; a null or destroyed object returns string.Empty.
[AddComponentMenu] | GetInspectorTitle() | GetDisplayName() |
|---|---|---|
| none | Ability Caster (Script) | Ability Caster |
"Gameplay/Ability" on AbilityCaster | Ability | Ability |
"Gameplay/Ability" on a base class | Ability Caster (Script) | Ability Caster |
GetDisplayNameWithIndex()
Works on Component. The number is the position among components of the same type on the GameObject; a null or destroyed component returns string.Empty.
| Components on the GameObject | Labels |
|---|---|
AbilityCaster | Ability Caster |
AbilityCaster, AbilityCaster | Ability Caster (1), Ability Caster (2) |
AbilityCaster, class FireCaster : AbilityCaster | Ability Caster, Fire Caster |
Package sample
In EditorTools, GetDisplayName() titles the custom inspector of the AbilityConfig asset.