コード例 #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
ファイル: AngleRangeController.cs プロジェクト: 0geova0/Jam
        private void SetSelectedIndexFromPreviewAngle()
        {
            var index = SpriteShapeEditorUtility.GetRangeIndexFromAngle(cache.angleRanges, cache.previewAngle);

            SelectIndex(index);
        }