using UnityEngine; namespace UnityEngine.ProBuilder { /// /// A Transform class limited to 2D /// sealed class Transform2D { /// /// Position in 2D space. /// public Vector2 position; /// /// Rotation in degrees. /// public float rotation; /// /// Scale in 2D space. /// public Vector2 scale; public Transform2D(Vector2 position, float rotation, Vector2 scale) { this.position = position; this.rotation = rotation; this.scale = scale; } public Vector2 TransformPoint(Vector2 p) { p += position; p.RotateAroundPoint(p, rotation); p.ScaleAroundPoint(p, scale); return p; } public override string ToString() { return "T: " + position + "\nR: " + rotation + PreferenceKeys.DEGREE_SYMBOL + "\nS: " + scale; } } }