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); } }
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); }