Esempio n. 1
0
            public override void Init()
            {
                state.name = name;
                state.fsm  = fsm;

                state.Init();
            }
Esempio n. 2
0
            override public void Init()
            {
                state.name = name;
                state.fsm  = fsm;
                state.mono = mono;

                state.Init();
            }
Esempio n. 3
0
        /// <summary>
        /// Adds a new node / state to the state machine
        /// </summary>
        /// <param name="name">The name / identifier of the new state</param>
        /// <param name="state">The new state instance, e.g. <c>State</c>, <c>CoState</c>, <c>StateMachine</c></param>
        public void AddState(string name, StateBase state)
        {
            state.fsm  = this;
            state.name = name;
            state.mono = mono;

            state.Init();

            nameToState[name] = state;

            if (nameToState.Count == 1 && startState == null)
            {
                SetStartState(name);
            }
        }