protected virtual void SetupShapeEditorOutline(SpriteRect spriteRect)
        {
            SpriteOutlineList spriteOutlineList = this.m_Outline[spriteRect.spriteID];

            if (spriteOutlineList.spriteOutlines == null || spriteOutlineList.spriteOutlines.Count == 0)
            {
                List <SpriteOutline> list = SpriteOutlineModule.GenerateSpriteRectOutline(spriteRect.rect, (Math.Abs(spriteOutlineList.tessellationDetail - -1f) >= Mathf.Epsilon) ? spriteOutlineList.tessellationDetail : 0f, 0, this.m_TextureDataProvider);
                if (list.Count == 0)
                {
                    Vector2 vector = spriteRect.rect.size * 0.5f;
                    list = new List <SpriteOutline>
                    {
                        new SpriteOutline
                        {
                            m_Path = new List <Vector2>
                            {
                                new Vector2(-vector.x, -vector.y),
                                new Vector2(-vector.x, vector.y),
                                new Vector2(vector.x, vector.y),
                                new Vector2(vector.x, -vector.y)
                            }
                        }
                    };
                }
                this.m_Outline[spriteRect.spriteID].spriteOutlines = list;
            }
        }
 protected virtual void SetupShapeEditorOutline(SpriteRect spriteRect)
 {
     if (spriteRect.outline == null || spriteRect.outline.Count == 0)
     {
         spriteRect.outline = SpriteOutlineModule.GenerateSpriteRectOutline(spriteRect.rect, this.spriteEditorWindow.selectedTexture, spriteRect.tessellationDetail, 0);
         if (spriteRect.outline.Count == 0)
         {
             Vector2 vector = spriteRect.rect.size * 0.5f;
             spriteRect.outline = new List <SpriteOutline>
             {
                 new SpriteOutline
                 {
                     m_Path = new List <Vector2>
                     {
                         new Vector2(-vector.x, -vector.y),
                         new Vector2(-vector.x, vector.y),
                         new Vector2(vector.x, vector.y),
                         new Vector2(vector.x, -vector.y)
                     }
                 }
             };
         }
         this.spriteEditorWindow.SetDataModified();
     }
 }
Beispiel #3
0
 protected override void SetupShapeEditorOutline(SpriteRect spriteRect)
 {
     if (spriteRect.physicsShape == null || spriteRect.physicsShape.Count == 0)
     {
         spriteRect.physicsShape = SpriteOutlineModule.GenerateSpriteRectOutline(spriteRect.rect, this.spriteEditorWindow.selectedTexture, (Math.Abs(spriteRect.tessellationDetail - -1f) >= Mathf.Epsilon) ? spriteRect.tessellationDetail : this.kDefaultPhysicsTessellationDetail, this.kDefaultPhysicsAlphaTolerance);
         this.spriteEditorWindow.SetDataModified();
     }
 }
Beispiel #4
0
        protected override void SetupShapeEditorOutline(SpriteRect spriteRect)
        {
            SpriteOutlineList spriteOutlineList = this.m_Outline[spriteRect.spriteID];

            if (spriteOutlineList.spriteOutlines == null || spriteOutlineList.spriteOutlines.Count == 0)
            {
                List <SpriteOutline> spriteOutlines = SpriteOutlineModule.GenerateSpriteRectOutline(spriteRect.rect, (Math.Abs(spriteOutlineList.tessellationDetail - -1f) >= Mathf.Epsilon) ? spriteOutlineList.tessellationDetail : this.kDefaultPhysicsTessellationDetail, this.kDefaultPhysicsAlphaTolerance, this.m_TextureDataProvider);
                this.spriteEditorWindow.SetDataModified();
                this.m_Outline[spriteRect.spriteID].spriteOutlines = spriteOutlines;
            }
        }