Create a gist now

Instantly share code, notes, and snippets.

What would you like to do?
This script accompanies basic button setup and disappear the button
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class MenuSystem : MonoBehaviour {
public GameObject startGame;
public GameObject options;
// Use this for initialization
void Start () {
Button startBtn = menuCanvas.transform.Find ("Main Menu").Find ("Start Game").GetComponent<Button> ();
Button optionBtn = menuCanvas.transform.Find ("Main Menu").Find ("Options").GetComponent<Button> ();
/* START BUTTON */
startBtn.onClick.AddListener (() => {
Debug.Log ("Start Game");
// Remove the start button
startGame.SetActive(false);
});// start button
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment