Ejemplo n.º 1
0
        public override void RunFrameUpdate()
        {
            if (UpdateAnimation())
            {
                //Debug.Log(ANIMATION_DATA.PlayTime);
                if (DurationTimePassed())
                {
                    characterStateController.ChangeState((int)PlayerState.HumanoidIdle);
                    return;
                }

                if (attack.UpdateHit(TouchDetectorType.ATTACK_RIGHT_FOOT, ref attack.Target))
                {
                    if (attack.Target.characterStateController.CurrentState.ANIMATION_DATA.characterAnimator.GetFloat("DeathAnimationIndex") == 1f)
                    {
                        if (!attack.Target.moveData.IsGrounded)
                        {
                            CharacterDeath targetDeathState = attack.Target.characterStateController.CurrentState as CharacterDeath;

                            if (CONTROL_MECHANISM.IsFacingForward())
                            {
                                targetDeathState.CONTROL_MECHANISM.transform.rotation = Quaternion.Euler(new Vector3(0f, 180f, 0f));
                            }
                            else
                            {
                                targetDeathState.CONTROL_MECHANISM.transform.rotation = Quaternion.Euler(new Vector3(0f, 0f, 0f));
                            }

                            targetDeathState.ProcSpinKickReaction();
                        }
                    }
                }
            }
        }
Ejemplo n.º 2
0
        public void OnClickReviveEnemy()
        {
            foreach (ControlMechanism c in characterManager.ListEnemies)
            {
                if (c.characterStateController.CurrentState.GetType() == typeof(CharacterDeath))
                {
                    //Debug.Log("reviving enemy");
                    CharacterDeath deathState = c.characterStateController.CurrentState as CharacterDeath;
                    deathState.Revive();
                }
            }

            /*if (characterManager.ListEnemies[0].characterStateController.CurrentState.GetType() == typeof(CharacterDeath))
             * {
             *  //Debug.Log("reviving enemy");
             *  CharacterDeath deathState = characterManager.ListEnemies[0].characterStateController.CurrentState as CharacterDeath;
             *  deathState.Revive();
             * }*/
        }