コード例 #1
0
        public virtual void ReceiveFromParentEditor(R editObject, ChildEditorCallback <R> callBack)
        {
            mEditObject = editObject;
            if (callBack != null)
            {
                //this will preserve the callback
                //if we call this again to reset items
                mCallBack = callBack;
            }

            if (Manager.IsAwake <GUIManager>())
            {
                GUIManager.Get.GetFocus(this);
            }
            //if it's a generic dialog result subscribe to the refresh action
            GenericDialogResult gdr = mEditObject as GenericDialogResult;

            if (gdr != null)
            {
                gdr.RefreshAction += Refresh;
            }
            PushEditObjectToNGUIObject();
            if (!Visible)
            {
                Show();
            }
        }
コード例 #2
0
        protected override void OnFinish()
        {
            if (mFinished)
            {
                return;
            }

            //if the edit object inherits from GenericDialogResult set its EditorFinished property here
            GenericDialogResult gdr = mEditObject as GenericDialogResult;

            if (gdr != null)
            {
                gdr.EditorFinished = true;
                gdr.RefreshAction -= Refresh;
            }

            if (mCallBack != null)
            {
                //if the callback isn't null, then the parent will take care of the transition
                mCallBack(mEditObject, this);
            }

            base.OnFinish();
        }