public AbstractDeadStateDecorator(Controller controller, DeadReason reason, TurnDirection direction = TurnDirection.None) : base(controller)
 {
     horizontSpeed = -controller.ControllerParams.RunSpeed;
     if (controller.ShieldIn != null)
     {
         controller.ShieldIn.enabled = false;
     }
     if (controller.ShieldOut != null)
     {
         controller.ShieldOut.enabled = false;
     }
     if (controller.WrenchInHand != null)
     {
         controller.WrenchInHand.enabled = false;
     }
     if (controller.WrenchOnBelt != null)
     {
         controller.WrenchOnBelt.enabled = true;
     }
     if (bounceCount == 0)
     {
         ApplyFallingAnimation();
     }
     stopWatch = 2;
     ihntGUI.Instance.HideIngameGUI();
     ihntGUI.Instance.ShowGameOverGUI("levelNN");
     GameManager.Instance.LevelFinished(false);
 }
        public string GetDeadReasonDesc(DeadReason deadReason)
        {
            switch (deadReason)
            {
            case DeadReason.None:
                return("幸存");

            case DeadReason.Hunter:
                return("死于猎人");

            case DeadReason.Vote:
                return("死于投票");
            }
            return("");
        }
Example #3
0
        public void PlayDeadSound(DeadReason reason)
        {
            if (audioSource)
            {
                audioSource.Stop();
                audioSource.loop = false;
                switch (reason)
                {
                case DeadReason.BatareyLow:
                    audioSource.clip = BatteryLow;
                    break;

                case DeadReason.DangerZone:
                    audioSource.clip = DangerZone;
                    break;

                case DeadReason.EnemyForward:
                case DeadReason.EnemySide:
                    audioSource.clip = EnemyDeadth;
                    break;

                case DeadReason.ForwardCollision:
                    audioSource.clip = ForwardCollision;
                    break;

                case DeadReason.HP:
                    audioSource.clip = HP;
                    break;

                default:
                    audioSource.clip = ForwardCollision;
                    break;
                }
                if (audioSource.clip)
                {
                    audioSource.Play();
                }
            }
        }
Example #4
0
 public virtual void Dead(DeadReason deadReason)
 {
     controller.DeadState.DeadReason = deadReason;
     controller.SetState(controller.DeadState);
 }
Example #5
0
 public void Die(DeadReason deadReason)
 {
     life.Die();
     currentState.Dead(deadReason);
 }
Example #6
0
 public override void Dead(DeadReason deadReason)
 {
 }