Пример #1
0
 public override void OnStateEnter(Animator animator, AnimatorStateInfo stateInfo, int layerIndex)
 {
     if (fighter == null)
     {
         fighter = animator.gameObject.GetComponent <FIGHTER>();
     }
     fighter.currentStates = behaviourStates;
     if (soundsEffect != null)
     {
         //fighter.PlaySound(soundsEffect);
     }
     fighter.body.AddRelativeForce(new Vector3(0, verticalForce, 0));
 }
Пример #2
0
 protected override void handleRun()
 {
     if (!FIGHTER.inRange())
     {
         switch (FIGHTER.CHARACTER_STATE)
         {
         case FighterStateMachine.eCharacterState.idle:
             FIGHTER.goToOpponent();
             break;
         }
     }
     else
     {
         switch (FIGHTER.CHARACTER_STATE)
         {
         case FighterStateMachine.eCharacterState.run:
         case FighterStateMachine.eCharacterState.walk:
             FIGHTER.onIdle();
             setTrigger((int)eTrigger.reached);
             break;
         }
     }
 }
Пример #3
0
        protected override void handleRun()
        {
            base.handleRun();
            FIGHTER.debugFieldOfView();
            if (FIGHTER.OPPONENT == null || mCamera == null)
            {
                return;
            }

            //Fighter fOpponent = FIGHTER.OPPONENT.GetComponent<Fighter>();
            planes = GeometryUtility.CalculateFrustumPlanes(FIGHTER.CAMERA);
            Collider collider = FIGHTER.OPPONENT.GetComponent <Collider>();

            if (GeometryUtility.TestPlanesAABB(planes, collider.bounds))
            {
                LOGGER.log("found");
                checkForPlayer();
                setTrigger((int)eTrigger.found);
            }
            //float distance = Vector3.Distance (FIGHTER.OPPONENT.transform.position, FIGHTER.transform.position);
            //if (distance <= 4) {

            //}
        }
Пример #4
0
 public ActionAttack(int id, Fighter fighter)
     : base(id, fighter)
 {
     mFighterAnimation = FIGHTER.GetComponent <Character.Anim.FighterAnimation> ();;
 }