GetSpriteUVs() private method

private GetSpriteUVs ( Sprite sprite, bool getAtlasData ) : Vector2[]
sprite UnityEngine.Sprite
getAtlasData bool
return Vector2[]
Ejemplo n.º 1
0
 protected override void DrawGizmos()
 {
     if (!((UnityEngine.Object) this.m_SelectedSprite != (UnityEngine.Object)null) || !((UnityEngine.Object) this.m_Texture != (UnityEngine.Object)null))
     {
         return;
     }
     Vector2[]           spriteUvs   = SpriteUtility.GetSpriteUVs(this.m_SelectedSprite, true);
     PackerWindow.Edge[] uniqueEdges = this.FindUniqueEdges(this.m_SelectedSprite.triangles);
     SpriteEditorUtility.BeginLines(new Color(0.3921f, 0.5843f, 0.9294f, 0.75f));
     foreach (PackerWindow.Edge edge in uniqueEdges)
     {
         this.DrawLineUtility(spriteUvs[(int)edge.v0], spriteUvs[(int)edge.v1]);
     }
     SpriteEditorUtility.EndLines();
 }
Ejemplo n.º 2
0
 protected override void DrawGizmos()
 {
     if ((this.m_SelectedSprite != null) && (base.m_Texture != null))
     {
         Vector2[] spriteUVs = SpriteUtility.GetSpriteUVs(this.m_SelectedSprite, true);
         ushort[]  triangles = this.m_SelectedSprite.triangles;
         Edge[]    edgeArray = this.FindUniqueEdges(triangles);
         SpriteEditorUtility.BeginLines(new Color(0.3921f, 0.5843f, 0.9294f, 0.75f));
         foreach (Edge edge in edgeArray)
         {
             this.DrawLineUtility(spriteUVs[edge.v0], spriteUVs[edge.v1]);
         }
         SpriteEditorUtility.EndLines();
     }
 }
        protected override void DrawGizmos()
        {
            if (m_SelectedSprite != null && m_Texture != null)
            {
                Vector2[] uvs         = SpriteUtility.GetSpriteUVs(m_SelectedSprite, true);
                UInt16[]  indices     = m_SelectedSprite.triangles;
                Edge[]    uniqueEdges = FindUniqueEdges(indices);                            // Assumes that our mesh has no duplicate vertices

                SpriteEditorUtility.BeginLines(new Color(0.3921f, 0.5843f, 0.9294f, 0.75f)); // Cornflower blue :)
                foreach (Edge e in uniqueEdges)
                {
                    DrawLineUtility(uvs[e.v0], uvs[e.v1]);
                }
                SpriteEditorUtility.EndLines();
            }
        }
Ejemplo n.º 4
0
 protected override void DrawGizmos()
 {
     if (this.m_SelectedSprite != null && this.m_Texture != null)
     {
         Vector2[]           spriteUVs = SpriteUtility.GetSpriteUVs(this.m_SelectedSprite, true);
         ushort[]            triangles = this.m_SelectedSprite.triangles;
         PackerWindow.Edge[] array     = this.FindUniqueEdges(triangles);
         SpriteEditorUtility.BeginLines(new Color(0.3921f, 0.5843f, 0.9294f, 0.75f));
         PackerWindow.Edge[] array2 = array;
         for (int i = 0; i < array2.Length; i++)
         {
             PackerWindow.Edge edge = array2[i];
             this.DrawLineUtility(spriteUVs[(int)edge.v0], spriteUVs[(int)edge.v1]);
         }
         SpriteEditorUtility.EndLines();
     }
 }