CPlace was an entirely new area of development for me as my first custom tool, making use of the Unity Inspector, Handles and integrating the tool alongside other built in tools such as the Selection and Transform tools. This tool was made to supply features unseen in many other placement tools such as multiple object groups with individual names and weightings alongside individual item weightings.
The key features of the tool are:
A custom editor window holding all editable variables,
An in scene brush that will generate Objects on click dependent on the current palette / editor window setup,
The Palette makes use of an editor window with bindings to a serializable object. The bindings include user variables such as brush density, type and layers to ignore, alongside the key feature of the tool, being custom object groups.
The object groups consist of a group name, weight and object list, with the object list holding the groups individual objects, their individual weightings and a Y offset to account for objects with different pivots or desired placement positions.
The placement system consists of a ray cast from the mouse into the scene. The position and normal of the ray are then taken, with a new position being identified along the ray normal at an elevated position. From there, a random rotation and distance are used to generate a spawn position for an object. Finally, a ray is cast from this new position in the original rays normal direction, if the ray has not collided with something within the ignored layers list, an object is instantiated and the objects position along the normal is elevated by its height / 2 to ensure objects with a central pivot are placed correctly. This is repeated for as many objects that can fit within the zone, calculated from the brush radius, density and average width of the objects within the palette.
The Project initially required far more planning than what i had previously created both due to the tool needing to be user centered, and the fact that i had not worked with either the UI Toolkit or Custom Editor Tools before. Following the creation of some UI and Functionality Plans alongside planning the development using GitHub projects, the tool started to come together with a clear direction and a better understanding of the UI Toolkit Binding system.
I equally came to understand the importance of user feedback when creating a tool, as consistent feedback allowed for the tweaking of the UI and functionality to create a more efficient and user friendly final product that meets the users needs.