public override void OnActivate(int pinID) { switch (pinID) { case 10: if (!string.IsNullOrEmpty(this.parentName)) { this.parent = GameObject.Find(this.parentName); if (Object.op_Equality((Object)this.parent, (Object)null)) { DebugUtility.LogWarning("can not found gameObject:" + this.parentName); } } string text = LocalizedText.Get(this.Text); if (this.richTag) { text = LocalizedText.ReplaceTag(text); } string yesText = !string.IsNullOrEmpty(this.yesText) ? this.yesText : (string)null; string noText = !string.IsNullOrEmpty(this.noText) ? this.noText : (string)null; this.winGO = !string.IsNullOrEmpty(this.Title) ? UIUtility.ConfirmBoxTitle(LocalizedText.Get(this.Title), text, new UIUtility.DialogResultEvent(this.OnClickOK), new UIUtility.DialogResultEvent(this.OnClickCancel), this.parent, this.systemModal, this.systemModalPriority, yesText, noText) : UIUtility.ConfirmBox(text, new UIUtility.DialogResultEvent(this.OnClickOK), new UIUtility.DialogResultEvent(this.OnClickCancel), this.parent, this.systemModal, this.systemModalPriority, yesText, noText); if (Object.op_Inequality((Object)this.winGO, (Object)null) && this.unscaledTime) { Animator component = (Animator)this.winGO.GetComponent <Animator>(); if (Object.op_Inequality((Object)component, (Object)null)) { component.set_updateMode((AnimatorUpdateMode)2); } } this.ActivateOutputLinks(100); break; case 11: if (Object.op_Equality((Object)this.winGO, (Object)null)) { break; } if (string.IsNullOrEmpty(this.Title)) { Win_Btn_DecideCancel_FL_C btnDecideCancelFlC = !Object.op_Equality((Object)this.winGO, (Object)null) ? (Win_Btn_DecideCancel_FL_C)this.winGO.GetComponent <Win_Btn_DecideCancel_FL_C>() : (Win_Btn_DecideCancel_FL_C)null; this.winGO = (GameObject)null; if (Object.op_Inequality((Object)btnDecideCancelFlC, (Object)null)) { btnDecideCancelFlC.BeginClose(); } } else { Win_Btn_YN_Title_Flx winBtnYnTitleFlx = !Object.op_Equality((Object)this.winGO, (Object)null) ? (Win_Btn_YN_Title_Flx)this.winGO.GetComponent <Win_Btn_YN_Title_Flx>() : (Win_Btn_YN_Title_Flx)null; this.winGO = (GameObject)null; if (Object.op_Inequality((Object)winBtnYnTitleFlx, (Object)null)) { winBtnYnTitleFlx.BeginClose(); } } this.ActivateOutputLinks(101); break; } }
public static GameObject ConfirmBoxTitle(string title, string text, UIUtility.DialogResultEvent okEventListener, UIUtility.DialogResultEvent cancelEventListener, GameObject parent = null, bool systemModal = false, int systemModalPriority = -1) { GameSettings instance = GameSettings.Instance; Canvas canvas = UIUtility.PushCanvas(systemModal, systemModalPriority); if (Object.op_Inequality((Object)parent, (Object)null)) { ((Component)canvas).get_transform().SetParent(parent.get_transform()); } Win_Btn_YN_Title_Flx winBtnYnTitleFlx = UIUtility.Instantiate <Win_Btn_YN_Title_Flx>(instance.Dialogs.YesNoDialogWithTitle); ((Component)winBtnYnTitleFlx).get_transform().SetParent(((Component)canvas).get_transform(), false); winBtnYnTitleFlx.OnClickYes = okEventListener; winBtnYnTitleFlx.OnClickNo = cancelEventListener; winBtnYnTitleFlx.Text_Title.set_text(title); winBtnYnTitleFlx.Text_Message.set_text(text); UIUtility.FixFont(((Component)winBtnYnTitleFlx).get_gameObject()); return(((Component)winBtnYnTitleFlx).get_gameObject()); }