コード例 #1
0
        public FighterStateMachine(
            Fighter fighter,
            float runSpeed
            ) : base()
        {
            Character.Anim.FighterAnimation  fighterAnimation  = fighter.GetComponent <Character.Anim.FighterAnimation> ();
            Character.Anim.MoveableAnimation moveableAnimation = fighter.GetComponent <Character.Anim.MoveableAnimation> ();
            CharacterController characterController            = fighter.GetComponent <CharacterController> ();

            mActionIdle   = new ActionIdle((int)eCharacterState.idle, moveableAnimation);
            mActionAttack = new ActionAttack((int)eCharacterState.attack, fighter);
            mActionRun    = new ActionRun((int)eCharacterState.run, moveableAnimation, fighter.transform, characterController, runSpeed);
            mActionDie    = new ActionDie((int)eCharacterState.die, fighterAnimation);

            addAction(mActionIdle);
            addAction(mActionAttack);
            addAction(mActionRun);
            addAction(mActionDie);

            startNewAction((int)eCharacterState.idle, false);
        }
コード例 #2
0
ファイル: ActionAttack.cs プロジェクト: dgx80/unity-dgx
 public ActionAttack(int id, Fighter fighter)
     : base(id, fighter)
 {
     mFighterAnimation = FIGHTER.GetComponent <Character.Anim.FighterAnimation> ();;
 }
コード例 #3
0
 public ActionDie(int id, Character.Anim.FighterAnimation fighterAnimation)
     : base(id, false)
 {
     mFighterAnimation = fighterAnimation;
 }