Hey all. So in my game I have two scripts. One for the door manager and the door. In the game, the player can select one of 4 doors, one of them being the one that kills him. However, when the wrong door is selected, instead of loading scene 1, the death scene, it loads scene 2, which progresses in the game. Is there a way I can use tags or something to detect that it is the kill door? I'm terrible with C Sharp.
using UnityEngine;
using System.Collections;
public class Door: MonoBehaviour {
public bool killDoor = false;
// When player choose the door, pass the parameter here.
void OnMouseDown ()
{
if ( killDoor )
{
Application.LoadLevel (1);
print ( "Game over" );
}
else
print ( "Success!" );
Application.LoadLevel (2);
}
}
↧