コード例 #1
0
 // Use this for initialization
 protected override void init()
 {
     base.init();
     health            = 100;
     opponent          = player.GetComponent <Fighter> ();
     fighterAnimation  = GetComponent <Character.Anim.FighterAnimation> ();
     moveableAnimation = GetComponent <Character.Anim.MoveableAnimation> ();
 }
コード例 #2
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);
        }