Do you mean that you want to have several buttons with custom scripts? If the button's type is "custom script", your code has to be in the OnElementClick function. But you can separate logic for several menu elements like this:
public static void OnElementClick (Menu _menu, MenuElement _element, int _slot, int _buttonPressed)
{
if (_element.title.Equals("ElementName1")) {
Debug.Log ("Logic for ElementName1 here");
} else if (_element.title.Equals("ElementName2")) {
publicstaticvoidOnElementClick (Menu_menu, MenuElement_element, int_slot, int_buttonPressed) { // This function is called whenever a clickable element has a click type of "Custom Script". if (_element.title.Equals("Accedi")) { FacebookMainWrapper.instance.initFacebook (); FacebookMainWrapper.instance. CallFBLogin (); } elseif (_element.title.Equals("Condividi")) { FacebookMainWrapper.instance. TakeScreenshotWithMessage("Una brutta sorpresa in spiaggia - Scarica l'App htt://www.itunes.com/"); }
}
Do you think I can insert a function to Turn Off a certain menu?
Comments
{
// This function is called whenever a clickable element has a click type of "Custom Script".
if (_element.title.Equals("Accedi")) {
FacebookMainWrapper.instance.initFacebook ();
FacebookMainWrapper.instance. CallFBLogin ();
} else if (_element.title.Equals("Condividi")) {
FacebookMainWrapper.instance. TakeScreenshotWithMessage("Una brutta sorpresa in spiaggia - Scarica l'App htt://www.itunes.com/");
}
}