Hide
PositionHandle

Draw and use a position handle in the scene. If The decorated field is a GameObject/Component, the handle will just it's position. If the field is a Vector3/Vector2, the handle will write the world/local position to the field.

Parameters:

  • string space="this":the containing space. "this" means using the current target, null means using the world space, otherwise means using a callback or a field value. Only works for Vector3/Vector2 type.

You can use right click to show/hide handles.

Example of using it with vector types + DrawLabel:

using SaintsField; [PositionHandle(space: null), DrawLabel(nameof(worldPos3), space: null)] public Vector3 worldPos3; [PositionHandle(space: null), DrawLabel(nameof(worldPos2), space: null)] public Vector2 worldPos2; [PositionHandle, DrawLabel(nameof(localPos3))] public Vector3 localPos3; [PositionHandle, DrawLabel(nameof(localPos2))] public Vector2 localPos2;

Example of using with objects:

using SaintsField; [PositionHandle, DrawLabel("
quot;
+ nameof(LabelName)), GetComponentInChildren(excludeSelf: true)] public MeshRenderer[] meshChildren; private string LabelName(MeshRenderer target, int index) =>
quot;
{target.name}[{index}]";