Expose Property of Custom Ability

atmuc

Member
How can I expose a property of my custom ability on inspector Ultimate Character Locomotion/Abilities.

I can expose field like in Drive ability. When I set field on inspector, I does not call setter.


[SerializeField] protected bool m_CanAim;
public bool CanAim { get => m_CanAim; set => m_CanAim = value; }
 
If your ability inherits the Ability class then it'll show up automatically. If you are inheriting another ability type it may have a custom ability drawer. Take a look at the AbilityDrawers folder for examples.
 
public class MyAbility: Ability
{
[SerializeField] protected bool m_CanAimField;

public bool CanAimProperty
{
get => m_CanAimField;
set
{
m_CanAimField = value;
Debug.LogFormat("CanAim:{0}", m_CanAimField);
}
}

1676658318184.png

Am I doing something wrong? I want to show property in inspector.
 
That looks correct. The inspector does not display properties. If you want to call the property then you will need to create a new AbilityDrawer.
 
Top