This is a small proof-of-concept project in Unity 2022 to enable the free translation and modification of various axis-aligned rectangles in-scene. The rectangles are oriented on the xz plane. This was made to help a student out with some initial code for a tools development module. The solution uses a single class, Rectangle
, which has four points as members. The RectangleEditor
editor script performs in-scene tooling via the Handles
class to:
- Enable free movement of the rectangles via a handle in the centroid of the rectangle.
- Enable free, axis-aligned resizing of the rectangles via the four small circles shown in the image above.
This code is licensed under the Unlicense; feel free to copy, modify or whatever.