void EndSequence() { fBlack.Fade(); medusa.SetActive(false); pHealth.gameObject.GetComponent <Movement> ().enabled = false; if (pHealth.IsAlive()) { Debug.Log("You win!"); victoryText.gameObject.SetActive(true); } else { Debug.Log("You lose!"); defeatText.gameObject.SetActive(true); } buttons.SetActive(true); Cursor.lockState = CursorLockMode.None; }
void OnTriggerEnter2D(Collider2D collider) { if (collider.tag == "Player") { game_.reachedFinish = true; if (game_.HasMetWinConditions()) { player_.enabled = false; player_.GetComponent <Rigidbody2D>().velocity = Vector3.zero; playerGettingAnimated_ = true; animator_.SetTrigger("Finished"); fadeToBlack_.Fade(2.5f); } cantFinishReasonText_.Fade(2.0f); } }
public void Kill() { if (alive_ == false) { return; } if (game_.state == GameState.Game) { alive_ = false; rigidBody_.velocity = Vector3.zero; rigidBody_.simulated = false; enabled = false; SetVisible(false); Instantiate(deathPrefab, transform.position, Quaternion.identity, null); SetParticlesEnabled(false); audioSources_[1].Stop(); fadeToBlack_.Fade(4.0f); reminder_.SetActive(true); } }