Start() public method

Call this to trigger the before action on the first state in the list
public Start ( ) : void
return void
Exemplo n.º 1
0
        /// <summary>
        /// 这里的状态不是指的AI,而是不同的状态下,播放不同的动作,接受不同的输入,有不同的行为
        /// </summary>
        /// <returns></returns>
        public static FsmSystem CreateFsmSystem(BaseEntity entity)
        {
            FsmSystem fsmSystem = new FsmSystem(entity);

            AddState <EntityIdleState>(entity, fsmSystem, E_StateId.idle);
            AddState <EntityAttackState>(entity, fsmSystem, E_StateId.attack);
            AddState <EntitySleepState>(entity, fsmSystem, E_StateId.sleep);
            AddState <EntityMoveState>(entity, fsmSystem, E_StateId.move);
            AddState <EntityDieState>(entity, fsmSystem, E_StateId.die);
            AddState <EntitySkillState>(entity, fsmSystem, E_StateId.skill);
            AddState <EntityHurtState>(entity, fsmSystem, E_StateId.hurt);
            fsmSystem.Start();
            return(fsmSystem);
        }