using Unity.Mathematics; namespace UnityEngine.Splines { /// /// Base class for SplineInstantiate and SplineExtrude, contains common elements to both of these Components /// public abstract class SplineComponent : MonoBehaviour { /// /// Describes the different types of object alignment axes. /// public enum AlignAxis { /// Object space X axis. [InspectorName("Object X+")] XAxis, /// Object space Y axis. [InspectorName("Object Y+")] YAxis, /// Object space Z axis. [InspectorName("Object Z+")] ZAxis, /// Object space negative X axis. [InspectorName("Object X-")] NegativeXAxis, /// Object space negative Y axis. [InspectorName("Object Y-")] NegativeYAxis, /// Object space negative Z axis. [InspectorName("Object Z-")] NegativeZAxis } readonly float3[] m_AlignAxisToVector = new float3[] {math.right(), math.up(), math.forward(), math.left(), math.down(), math.back()}; /// /// Transform a AlignAxis to the associated float3 direction. /// /// The AlignAxis to transform /// protected float3 GetAxis(AlignAxis axis) { return m_AlignAxisToVector[(int) axis]; } } }