π¦₯Placement Bounds
Check out how placement bounds function and how to implement your own!
Overview
For defining object's placement bounds interface IPlacementBounds is used, it must define bounds and rotation the object and its reference to gameObject
itself.
Provided components which implement this interface:
APlacementBounds: abstract class for implementing custom behaviour
CustomPlacementBounds: defines bounds by
center
&size
propertiesRendererPlacementBounds: supports referencing a specific renderer from which bounds are retrieved
ColliderPlacementBounds: supports referencing a specific collider from which bounds are calculated
IPlacementBounds or APlacementBounds can be used to implement your own behaviour for placement bounds
Best Practices
It is recommended that these bounds are defined in Editor and not at runtime. However it is still possible to do it in code.
Example 1:
Example 2:
Last updated