Editor Helpers
Object labels without “(Script)” and numbering for components of the same type.
Quick start
| Before — Unity API | After — FastTools |
|---|---|
ObjectNames.GetInspectorTitle(caster) | caster.GetDisplayName() |
Ability Caster (Script) | Ability Caster |
GetDisplayName()
Returns a readable type name for any UnityEngine.Object, rather than the value of Object.name.
[AddComponentMenu] | GetInspectorTitle() | GetDisplayName() |
|---|---|---|
| none | Ability Caster (Script) | Ability Caster |
"Gameplay/Ability" on AbilityCaster | Ability | Ability |
GetDisplayNameWithIndex()
Adds a number when a GameObject has multiple components of the same type. Numbering starts at 1 and follows component order.
| Components on the GameObject | Labels |
|---|---|
AbilityCaster | Ability Caster |
AbilityCaster, AbilityCaster | Ability Caster (1), Ability Caster (2) |
AbilityCaster and its subclass FireCaster | Ability Caster, Fire Caster |
Both methods return string.Empty for a null or destroyed object.
Package sample
In EditorTools, GetDisplayName() names the AbilityConfig script in the tooltip of the ability title.

