Пример #1
0
 public override void OnModuleDeactivate()
 {
     this.undoSystem.UnregisterUndoCallback(new Undo.UndoRedoCallback(this.UndoRedoPerformed));
     this.CleanupShapeEditors();
     this.m_Selected = null;
     this.spriteEditorWindow.enableMouseMoveEvent = false;
     if (this.m_Outline != null)
     {
         this.undoSystem.ClearUndo(this.m_Outline);
         UnityEngine.Object.DestroyImmediate(this.m_Outline);
         this.m_Outline = null;
     }
 }
Пример #2
0
 public override void OnModuleDeactivate()
 {
     undoSystem.UnregisterUndoCallback(UndoRedoPerformed);
     CleanupShapeEditors();
     m_Selected = null;
     spriteEditorWindow.enableMouseMoveEvent = false;
     if (m_Outline != null)
     {
         undoSystem.ClearUndo(m_Outline);
         ScriptableObject.DestroyImmediate(m_Outline);
         m_Outline = null;
     }
 }
Пример #3
0
        protected virtual void LoadOutline()
        {
            m_Outline = ScriptableObject.CreateInstance <SpriteOutlineModel>();
            var spriteDataProvider  = spriteEditorWindow.GetDataProvider <ISpriteEditorDataProvider>();
            var outlineDataProvider = spriteEditorWindow.GetDataProvider <ISpriteOutlineDataProvider>();

            foreach (var rect in spriteDataProvider.GetSpriteRects())
            {
                var outlines = outlineDataProvider.GetOutlines(rect.spriteID);
                m_Outline.AddListVector2(rect.spriteID, outlines);
                m_Outline[m_Outline.Count - 1].tessellationDetail = outlineDataProvider.GetTessellationDetail(rect.spriteID);
            }
        }
Пример #4
0
        protected virtual void LoadOutline()
        {
            this.m_Outline = ScriptableObject.CreateInstance <SpriteOutlineModel>();
            ISpriteEditorDataProvider  dataProvider  = this.spriteEditorWindow.GetDataProvider <ISpriteEditorDataProvider>();
            ISpriteOutlineDataProvider dataProvider2 = this.spriteEditorWindow.GetDataProvider <ISpriteOutlineDataProvider>();

            SpriteRect[] spriteRects = dataProvider.GetSpriteRects();
            for (int i = 0; i < spriteRects.Length; i++)
            {
                SpriteRect       spriteRect = spriteRects[i];
                List <Vector2[]> outlines   = dataProvider2.GetOutlines(spriteRect.spriteID);
                this.m_Outline.AddListVector2(spriteRect.spriteID, outlines);
                this.m_Outline[this.m_Outline.Count - 1].tessellationDetail = dataProvider2.GetTessellationDetail(spriteRect.spriteID);
            }
        }
Пример #5
0
 public override bool ApplyRevert(bool apply)
 {
     if (this.m_Outline != null)
     {
         if (apply)
         {
             ISpriteOutlineDataProvider dataProvider = this.spriteEditorWindow.GetDataProvider <ISpriteOutlineDataProvider>();
             for (int i = 0; i < this.m_Outline.Count; i++)
             {
                 dataProvider.SetOutlines(this.m_Outline[i].spriteID, this.m_Outline[i].ToListVector());
                 dataProvider.SetTessellationDetail(this.m_Outline[i].spriteID, this.m_Outline[i].tessellationDetail);
             }
         }
         UnityEngine.Object.DestroyImmediate(this.m_Outline);
         this.m_Outline = null;
     }
     return(true);
 }
Пример #6
0
        public override bool ApplyRevert(bool apply)
        {
            if (m_Outline != null)
            {
                if (apply)
                {
                    var outlineDataProvider = spriteEditorWindow.GetDataProvider <ISpriteOutlineDataProvider>();
                    for (int i = 0; i < m_Outline.Count; ++i)
                    {
                        outlineDataProvider.SetOutlines(m_Outline[i].spriteID, m_Outline[i].ToListVector());
                        outlineDataProvider.SetTessellationDetail(m_Outline[i].spriteID, m_Outline[i].tessellationDetail);
                    }
                }

                ScriptableObject.DestroyImmediate(m_Outline);
                m_Outline = null;
            }

            return(true);
        }