mirror of
https://gitgud.io/AbstractConcept/rimworld-animation-studio.git
synced 2024-08-15 00:43:27 +00:00
Initial commit
This commit is contained in:
commit
3c7cc0c973
8391 changed files with 704313 additions and 0 deletions
|
@ -0,0 +1,35 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
|
||||
namespace UnityEditor.U2D.Path
|
||||
{
|
||||
public struct Polygon : IShape
|
||||
{
|
||||
public bool isOpenEnded;
|
||||
|
||||
public Vector3[] points;
|
||||
|
||||
ShapeType IShape.type => ShapeType.Polygon;
|
||||
|
||||
bool IShape.isOpenEnded => isOpenEnded;
|
||||
|
||||
ControlPoint[] IShape.ToControlPoints()
|
||||
{
|
||||
if (points == null)
|
||||
throw new NullReferenceException("Points array is null");
|
||||
|
||||
var controlPoints = new List<ControlPoint>();
|
||||
|
||||
foreach (var point in points)
|
||||
{
|
||||
controlPoints.Add(new ControlPoint() { position = point });
|
||||
}
|
||||
|
||||
return controlPoints.ToArray();
|
||||
}
|
||||
|
||||
public static Polygon empty = new Polygon() { isOpenEnded = true, points = new Vector3[0] };
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue