// Use this for initialization public void Start() { uiMgr = GameObject.FindWithTag("UIManager"); menuMgr = uiMgr.GetComponent <MainMenu_UIManager> (); components = gameObject.GetComponentsInChildren <Button>(); }
private void Awake() { if (instance == null) { instance = this; } else if (instance != null) { Debug.Log("Instance already exists, destroying object!"); Destroy(this); } }