public void Done(RocketStatus status) { var view = (DataContext as RocketViewModel); view.FlightStatus = status; var counter = 0; foreach (var item in status.GetType().GetProperties()) { bool b = false; bool.TryParse(item.GetValue(status).ToString(), out b); if (b) { counter++; } } Red.Fill = new SolidColorBrush(Color.FromRgb(0xFF, 0x0, 0x0)); if (counter == 2) { Orange.Fill = new SolidColorBrush(Color.FromRgb(0xFF, 0xA5, 0x00)); } else if (counter > 3) { Green.Fill = new SolidColorBrush(Color.FromRgb(0x00, 0xFF, 0x00)); } }
public void Stop() { if (abilityInstance != null) { Destroy(abilityInstance.gameObject); } status = RocketStatus.Disabled; }
void Start() { m_currentRocketStatus = LvlMgr.currentRocketStatus; m_random = new System.Random(1); GameObject respawnRoot = GameObject.FindGameObjectWithTag("Respawn"); for (int i = 0; i < respawnRoot.transform.childCount; i++) { Transform t = respawnRoot.transform.GetChild(i); if (t.gameObject.activeSelf) { m_possibleLeakSpawns.Add(t); } } }
private void OnCollisionEnter(Collision collision) { if (collision.gameObject.tag.ToLower() != "friendly" && collisionEnabled) { if (collision.gameObject.tag.ToLower() == "finish") //If ship reached landing pad { sound.Stop(); status = RocketStatus.Transcending; sound.PlayOneShot(winningSound); winningParticles.Play(); Invoke("changeLevel", loadLevelDelay); } else // If ship touched an obstacle { sound.Stop(); status = RocketStatus.Dead; sound.PlayOneShot(explosionSound); explosionParticles.Play(); Invoke("changeLevel", loadLevelDelay); } } }
public void DieWithoutLoss() { Group.OnRocketDie(this, false); status = RocketStatus.Dead; StartCoroutine(DieAnimation()); }
protected void Die() { Group.OnRocketDie(this, true); status = RocketStatus.Dead; StartCoroutine(DieAnimation()); }
// Start is called before the first frame update void Start() { startTime = Time.time; OxygenLevel = maxOxygen; currentRocketStatus = new RocketStatus(); }