public static void Die() { died = true; Shaker.SetShakeLengthSpeed(1f, 55f); Shaker.Shake(0.12f); Reder.MakeRed("dead"); Time.timeScale = 0.5f; AfterGameButtonListeners.year = Year.GetYear(); BlackFader.GoToScene("AfterGame", UnityEngine.SceneManagement.LoadSceneMode.Single, 1f, Instance.Ressurect, null); }
private void SendCommand(string command) { command = command.Substring(preText.Length, command.Length - preText.Length); command = command.ToLower(); bool found = true; if (command == "heal") { Health.Heal(10); Reder.MakeRed("green"); } else if (command == "destroy") { MissilesDestroyer.DestroyClosestMissile(); } else if (command == "destroy big") { MissilesDestroyer.DestroyClosestShip(); } else if (command == "oxygen") { Oxygen.IncreaseOxygenByPercent(20); } else if (command == "self destroy") { GameManager.Die(); } else { found = false; } if (found) { Vector3 pos = Camera.main.transform.position; pos.z = -10; AudioSource.PlayClipAtPoint(beep, pos, 0.5f); } }
public static void TakeDamage(int amount) { Reder.MakeRed("red"); SetHealth(Instance.health - amount); }