//点击其他按钮 public void OnOtherButtonClick() { RuntimeUIForm.Close(); if (m_OnClickOther != null) { m_OnClickOther.Invoke(UserData); } }
//点击取消按钮 public void OnCancelButtonClick() { RuntimeUIForm.Close(); if (m_OnClickCancel != null) { m_OnClickCancel.Invoke(UserData); } }
//点击确认按钮 public void OnConfirmButtonClick() { RuntimeUIForm.Close(); if (m_OnClickConfirm != null) { m_OnClickConfirm.Invoke(UserData); } }
//点击提交按钮 public void OnConfirmClick() { if (m_SelectedLanguage == GameEntry.Localization.Language) { RuntimeUIForm.Close(); return; } //保存持久层 GameEntry.Setting.SetString(RuntimeConstant.Setting.Language, m_SelectedLanguage.ToString()); GameEntry.Setting.Save(); GameEntry.Sound.StopMusic(); UnityGameFrame.Runtime.GameEntry.Shutdown(UnityGameFrame.Runtime.ShutdownType.Restart); //重新启动场景 }
private float m_InitPosition = 0f; //初始位置 public override void OnInit(object userData) { base.OnInit(userData); //画布大小 CanvasScaler canvasScaler = (CanvasScaler)RuntimeUIForm.GetComponentInParent(typeof(CanvasScaler)); if (canvasScaler == null) { HotLog.Warning("Can not find CanvasScaler component."); return; } //初始位置设置为高度的一半 m_InitPosition = -0.5f * canvasScaler.referenceResolution.x * Screen.height / Screen.width; ReferenceCollector collector = RuntimeUIForm.ReferenceCollector; m_RectTransform = (RectTransform)collector.Get("trans_Content", typeof(RectTransform)); (collector.Get("bt_Back", typeof(CommonButton)) as CommonButton).ComButtonAddClick(OnClickClose); }
//点击取消 public void OnCancelClick() { RuntimeUIForm.Close(); }
private void OnClickClose() { RuntimeUIForm.Close(); }