예제 #1
0
        public static void SetShapeFromAsset(SpriteShapeController spriteShapeController)
        {
            UnityEngine.U2D.SpriteShape spriteShape = spriteShapeController.spriteShape;

            if (!spriteShape)
            {
                SpriteShapeEditorUtility.SetToSquare(spriteShapeController);
                return;
            }

            if (spriteShape.angleRanges.Count == 1 && spriteShape.angleRanges[0].end - spriteShape.angleRanges[0].start == 360f)
            {
                SpriteShapeEditorUtility.SetToLine(spriteShapeController);
            }
            else if (spriteShape.angleRanges.Count < 8)
            {
                SpriteShapeEditorUtility.SetToSquare(spriteShapeController);
            }
            else
            {
                SpriteShapeEditorUtility.SetToOctogon(spriteShapeController);
            }
        }
예제 #2
0
        private void SetSelectedIndexFromPreviewAngle()
        {
            var index = SpriteShapeEditorUtility.GetRangeIndexFromAngle(cache.angleRanges, cache.previewAngle);

            SelectIndex(index);
        }