protected virtual bool HasShapeOutline(SpriteRect spriteRect)
        {
            SpriteOutlineList    expr_12 = this.m_Outline[spriteRect.spriteID];
            List <SpriteOutline> list    = (expr_12 != null) ? expr_12.spriteOutlines : null;

            return(list != null && list.Count > 0);
        }
        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;
            }
        }
Beispiel #3
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;
            }
        }