Coding Horror, be scared

Unity c#

So, I'm using c# right now to link a start menu and an exit menu for a game on Unity and I have a couple errors. I am doing this for a school project and the game will be linked later on but the game is a game where you build your own PC because I've never seen anyone do that before so I would be thankful if someone could correct this. I used a Youtube tutorial, here's the link:

using UnityEngine; using UnityEngine.UI; using System.Collections; public class menuScript : MonoBehaviour { public Canvas quitMenu; public Button startText; public Button exitText; private object startExit; public void Start() { quitMenu = quitMenu.GetComponent<Canvas>(); startText = startText.GetComponent<Button>(); exitText = exitText.GetComponent<Button>(); quitMenu.enabled = false; } public void ExitPress() { quitMenu.enabled = true; startExit.enabled = false; exitText.enabled = false; } public void NoPress() { quitMenu.enabled = false; startExit.enabled = true; exitText.enabled = true; } public void StartLevel() { Application.LoadLevel(1); } public void ExitGame() { Application.Quit(); } }

Reactions 0 reactions

No reactions yet, be the first: comment or tweak the code

Comment on this code:

Please Login or Register to leave a comment.