protected override void OnSerialize(bool dynamic)
 {
     base.OnSerialize(dynamic);
     if (!dynamic)
     {
         string id = GetID(false);
         EditorPrefsEx.SetObject(id, m_ObjDrawer);
     }
 }
예제 #2
0
        protected override void OnSerialize()
        {
            base.OnSerialize();
            if (m_Drawer == null)
            {
                return;
            }
            string id = GetID();

            EditorPrefsEx.SetObject(id, m_Drawer);
        }
        protected override void OnDestroy()
        {
            base.OnDestroy();
            m_ObjDrawer.OnDestroy();
            string id = GetID(false);

            if (EditorPrefsEx.HasKey(id))
            {
                EditorPrefsEx.DeleteKey(id);
            }
        }
        public SubWindowObjectDrawer(SubWindowCustomDrawer drawer)
        {
            this.m_ObjDrawer = drawer;
            if (m_ObjDrawer == null)
            {
                return;
            }
            string id = GetID(false);

            if (EditorPrefsEx.HasKey(id))
            {
                var obj = EditorPrefsEx.GetObject(id, drawer.GetType());
                if (obj != null)
                {
                    drawer = (SubWindowCustomDrawer)obj;
                    drawer.SetContainer(this.m_ObjDrawer.Container);
                    this.m_ObjDrawer = drawer;
                }
            }
        }
예제 #5
0
        public EWMsgBoxObjectDrawer(EWMsgBoxCustomDrawer drawer)
        {
            m_Drawer = drawer;
            if (m_Drawer == null)
            {
                return;
            }
            string id = GetID();

            if (EditorPrefsEx.HasKey(id))
            {
                var obj = EditorPrefsEx.GetObject(id, drawer.GetType());
                if (obj != null)
                {
                    drawer = (EWMsgBoxCustomDrawer)obj;
                    drawer.SetContainer(this.m_Drawer.Container);
                    drawer.closeAction = this.m_Drawer.closeAction;
                    this.m_Drawer      = drawer;
                }
            }
        }