public void OnPointerExit(PointerEventData eventData) { if (selected == false) { myText.color = normalColor; //Or however you do your color } if (text == true) { line1.enabled = false; line2.enabled = false; } else { if (selected == false) { line1.color = BackGroundColor; line2.color = BackGroundColor; } } myMenuFunction = null; }
// Use this for initialization void Start() { myText = GetComponentInChildren <Text>(); myText.color = normalColor; if (!text) { line1.color = BackGroundColor; } switch (menuFunction) { case StartMeunFunctions.MenuFunction.START: // Debug.Log("My delegate function starts the game"); myMenuFunction = FindObjectOfType <StartMenuManager>().StartGame; break; case StartMeunFunctions.MenuFunction.CONTROLS: myMenuFunction = ShowControlsMenu; // Debug.Log("My delegate function opens CONTROLS Menu"); break; case StartMeunFunctions.MenuFunction.QUIT: myMenuFunction = quitGame; // Debug.Log("My delegate function Quits the game"); break; case StartMeunFunctions.MenuFunction.CREDITS: // Debug.Log("My delegate function shows credits"); break; case StartMeunFunctions.MenuFunction.LEVEL: // Debug.Log("startMenuFunctions button for choosing a level"); break; default: break; } }
void SwitchDelegateFunction() { switch (menuFunction) { case StartMeunFunctions.MenuFunction.START: // Debug.Log("My delegate function starts the game"); myMenuFunction = FindObjectOfType <StartMenuManager>().StartGame; break; case StartMeunFunctions.MenuFunction.CONTROLS: myMenuFunction = ShowControlsMenu; // Debug.Log("My delegate function opens Options Menu"); break; case StartMeunFunctions.MenuFunction.QUIT: myMenuFunction = quitGame; // Debug.Log("My delegate function Quits the game"); break; case StartMeunFunctions.MenuFunction.CREDITS: // Debug.Log("My delegate function shows credits"); break; case StartMeunFunctions.MenuFunction.LEVEL: myMenuFunction = ChooseALevel; // Debug.Log("startMenuFunctions button for choosing a level"); break; case StartMeunFunctions.MenuFunction.SWITCHMENUS: myMenuFunction = SwitchMenu; break; default: break; } }