Browse Source

getting both players to objective triggers credits

master
Joshua Reason 9 years ago
parent
commit
67559709bd
2 changed files with 7 additions and 3 deletions
  1. +7
    -3
      unity_Project/Assets/Scripts/respawners.cs
  2. BIN
      unity_Project/Assets/_Scenes/MainLevel.unity

+ 7
- 3
unity_Project/Assets/Scripts/respawners.cs View File

@ -9,6 +9,8 @@ public class respawners : MonoBehaviour {
public GameObject respawnPoint; public GameObject respawnPoint;
public GameObject deathTrigger; public GameObject deathTrigger;
public bool objective = false;
private checkpoint deathScript; private checkpoint deathScript;
// Use this for initialization // Use this for initialization
@ -28,13 +30,15 @@ public class respawners : MonoBehaviour {
player2 = true; player2 = true;
if (player1 && player2) { if (player1 && player2) {
if (objective) {
Application.LoadLevel("CreditScreen");
}
deathTrigger.SetActive(true); deathTrigger.SetActive(true);
deathScript.respawnPoint = respawnPoint; deathScript.respawnPoint = respawnPoint;
gameObject.SetActive(false); gameObject.SetActive(false);
if (this.transform.tag == "end") {
Application.LoadLevel("CreditScene");
}
} }

BIN
unity_Project/Assets/_Scenes/MainLevel.unity View File


Loading…
Cancel
Save