コード例 #1
0
        public StateInfo(object stateId, ScriptableState stateObject)
        {
            _serializedStateId = PlainStateMachineGenericTypeSerializer.Serialize(stateId);

            _stateIdTypeFullName = stateId.GetType().FullName;

            _stateObject = stateObject;
        }
コード例 #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);
            }
        }