public StateInfo(object stateId, ScriptableState stateObject)
        {
            _serializedStateId = PlainStateMachineGenericTypeSerializer.Serialize(stateId);

            _stateIdTypeFullName = stateId.GetType().FullName;

            _stateObject = stateObject;
        }
Exemple #2
0
        internal void AddState(object stateId, ScriptableState stateObject)
        {
            if (stateId == null)
            {
                return;
            }

            if (StateIdType != stateId.GetType())
            {
                return;
            }

            if (ContainsState(stateId))
            {
                return;
            }

            _states.Add(new StateInfo(stateId, stateObject));

            if (_states.Count == 1)
            {
                SetInitialState(stateId);
            }
        }