StateObject serialization

Szymon Z.

Member
Hello.
I have a problem with StateSystem object.
My situation is like that:
- I have a custom ability. Let's call it CustomAbility : Ability
- In that ability i have some kind of Validator. That is ValidatorController : StateObject
So in very short way code is like that:


C#:
[Serializable]
public class ValidatorController : StateObject
{
    
    [SerializeField] private Validators[] m_validators;
    [SerializeField] private bool m_active;

    public bool Active { get => m_active; set => m_active = value}

}



public class CustomAbility : Ability
{
    [SerializeField] private ValidatorController m_validatorController;

}

What i expect is that, in inspector i want to have normal states drawer for object ValidatorController. But i have no luck with achieve that. In inspector i can see fields like m_validators or m_active, but no drawer for states. Am i missing something ?
 
Each class that uses the StateObject has its own inspector and calls StateInspector. You will need to do something similar with your custom class.
 
Top