public MessageBox Show(string text, MessageBox.Type type, UnityEngine.Object userData, MessageBox.MessageDelegate OkCallback, MessageBox.MessageDelegate CancelCallback) { MessageBox result = this.Show(text, type, userData); this.OkClick = OkCallback; this.CancelClick = CancelCallback; return result; }
private void OnDisable() { this.OkClick = null; this.CancelClick = null; this.userData = null; }
public MessageBox Show(string text, MessageBox.Type type, object data) { base.gameObject.SetActive(true); GameUITools.PlayOpenWindowAnim(this.messageBoxBg.transform, null, false); this.content.text = text; this.TextOK = Singleton<StringManager>.Instance.GetString("OK"); this.TextCancel = Singleton<StringManager>.Instance.GetString("Cancel"); bool flag = type == MessageBox.Type.OK || type == MessageBox.Type.Custom1Btn; Vector3 localPosition = this.btnOK.transform.localPosition; localPosition.x = ((!flag) ? 90.5f : 0f); this.btnOK.transform.localPosition = localPosition; NGUITools.SetActive(this.btnCancel.gameObject, !flag); this.OkClick = null; this.CancelClick = null; this.userData = data; this.delayOkTime = 0f; this.delayCancelTime = 0f; this.widgetOK.width = 83; this.widgetCancel.width = 83; this.btnOK.gameObject.collider.enabled = true; this.btnCancel.gameObject.collider.enabled = true; this.fadeBG.collider.enabled = true; base.CancelInvoke("DestroySelf"); Globals.Instance.TutorialMgr.InitializationCompleted(this, null); return this; }