示例#1
0
    public void Remove()
    {
        //Destroy( this.gameObject );
        ObjectPool.Recycle(this.gameObject);
        if (this.HideEvent != null)
        {
            this.HideEvent(this, this.mState);
        }
        if (this.hideCallback != null)
        {
            this.hideCallback(this, this.mState);
        }

        this.ShowedEvent  = null;
        this.HideEvent    = null;
        this.hideCallback = null;
    }
示例#2
0
 public void Dispose()
 {
     this.ShowedEvent  = null;
     this.HideEvent    = null;
     this.hideCallback = null;
 }
示例#3
0
文件: Dialog.cs 项目: daxingyou/-game
        public static void Show(GameObject go, bool isModal, Dialog.DialogCloseDelegate closeCallback, Dialog.DialogShowedDelegate showCallback)
        {
            if (go == null)
            {
                return;
            }
            UIDialogView dialog = go.GetComponent <UIDialogView>();

            if (dialog == null)
            {
                dialog = go.AddComponent <UIDialogView>();
            }
            if (closeCallback != null)
            {
                dialog.hideCallback += closeCallback;
            }
            if (showCallback != null)
            {
                dialog.ShowedEvent += showCallback;
            }
            dialog.mIsModal = isModal;

            if (Dialog.mNextDialog != null)
            {
                Dialog.mNextDialog.Remove();
                Dialog.mNextDialog = null;
            }
            Dialog.mNextDialog = dialog;

            Hide(DialogState.OK, delegate
            {
                ShowEx();
            });
        }