private IEnumerator waitForTimeClickEvent(CocoUINormalButton pButtonName) { yield return(new WaitForSeconds(0.3f)); clickOne = (pButtonName.ButtonKey == "ShowAlertViewOne"); processing = false; }
private void clickEvent(CocoUINormalButton pButtonName) { if (pButtonName.UseButtonID) { return; } StartCoroutine(waitForTimeClickEvent(pButtonName)); }
/// <summary> /// Raises the user interface button click event. /// </summary> /// <param name="buttonID">Button I.</param> private void OnUIButtonClick(CocoUINormalButton button) { if (button.UseButtonID) { OnButtonClickWithButtonId(button, button.ButtonID); } else { OnButtonClickWithButtonName(button, button.ButtonKey); } }
/// <summary> /// Raises the user interface button click event. /// </summary> /// <param name="buttonID">Button I.</param> protected virtual void OnUIButtonClick(CocoUINormalButton button) { if (!gameObject.activeInHierarchy) { return; } if (button.UseButtonID) { OnButtonClickWithButtonId(button.ButtonID); } else { OnButtonClickWithButtonName(button.ButtonKey); } }
/// <summary> /// Raises the button click with button identifier event. /// </summary> /// <param name="pButtonId">P button identifier.</param> protected virtual void OnButtonClickWithButtonId(CocoUINormalButton button, CocoUIButtonID buttonID) { //当使用的按钮以按钮id为key时继承 switch (buttonID) { case CocoUIButtonID.Common_Back: OnBackButtonClick(); break; // case GameButtonID.GoStore: // // m_MainController.ShowPopup(PlayerKey.Store_MainStore, IModalMaskType.NonMasked); // break; // // case GameButtonID.ItemStore: // // m_MainController.ShowPopup(PlayerKey.Store_MainStore, IModalMaskType.NonMasked); // // FindObjectOfType<MainStoreManager>().curButtonID = GameButtonID.ItemStore; // break; default: break; } }
/// <summary> /// Raises the button click with button name event. /// </summary> /// <param name="pButtonName">P button name.</param> protected virtual void OnButtonClickWithButtonName(CocoUINormalButton button, string pButtonName) { //当使用的按钮以按钮名的名字为key时继承 }