public void ShowModal( GUIManager.ModalType modalType, string strMessage, UIEventListener.VoidDelegate[] btnDelegates ) { if( modalType < GUIManager.ModalType.OneButtonModal || modalType > GUIManager.ModalType.ThreeButtonModal ) return; string strModalPrefab = modalType.ToString(); GameObject modal = GUIManager.Instance.InstantiateModalToParent( gameObject, strModalPrefab ); if( modal == null ) { Debug.Log( "Modal2D.ShowModal() - couldn't instantiate modal prefab" ); return; } // set current modal NGUITools.SetActive( modal, true ); CurrentModal = modal.GetComponent<UIModal>(); CurrentModal.InitModal( modalType, strMessage, btnDelegates, CommonBtnDelegate ); }
public void ShowWaitCoroutineModal( GUIManager.ModalType modalType, string strMessage, YieldInstruction instruction, float fDuration = 0.0f, System.Action waitCoroutineCallBack = null, System.Action waitCallBack = null ) { if( modalType != GUIManager.ModalType.WaitCoroutineModal ) return; string strModalPrefab = modalType.ToString(); GameObject modal = GUIManager.Instance.InstantiateModalToParent( gameObject, strModalPrefab ); if( modal == null ) { Debug.Log( "Modal2D.ShowWaitCoroutineModal() - couldn't instantiate modal prefab" ); return; } // set current modal NGUITools.SetActive( modal, true ); CurrentModal = modal.GetComponent<UIModal>(); StartCoroutine( CurrentModal.InitWaitCoroutineModal( modalType, strMessage, instruction, fDuration, waitCoroutineCallBack, waitCallBack ) ); }