using UnityEngine; using System.Collections; public class CompetitionBackButtonHandler : MonoBehaviour { private NGUIMenuScript hNGUIMenuScript; void Start() { hNGUIMenuScript = (NGUIMenuScript)GameObject.Find("UI Root (2D)").GetComponent(typeof(NGUIMenuScript)); } void OnClick() { if (hNGUIMenuScript.CurStatePopup == NGUIMenuScript.StatesMenuForPopup.Popup) { hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.GameOver); NGUITools.SetActive(this.transform.parent.gameObject, false); } else if (hNGUIMenuScript.CurStatePopup == NGUIMenuScript.StatesMenuForPopup.GameOver) { hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.GameOver); NGUITools.SetActive(this.transform.parent.gameObject, false); } else { hNGUIMenuScript.ShowMenu(NGUIMenuScript.NGUIMenus.LeaderBoardNew); NGUITools.SetActive(this.transform.parent.gameObject, false); } } }