FadelMS
Member
Hi,
Is there a way to add a custom property to a class derived from Ability?
And then access the property from the return of GetAbility()?
For example:
And then in a MonoBehaviour class, I access the custom property as follows:
Is there a way to add a custom property to a class derived from Ability?
And then access the property from the return of GetAbility()?
For example:
Code:
public class MyAbility : Ability
{
[HideInInspector][SerializeField] public float myProperty;
public float My_Property { get => myProperty; set => myProperty= value; }
}
Code:
Ability myAbility = m_characterLocomotion.GetAbility<MyAbility >();
myAbility.My_Propery = 1;