Skip to main content

InGameGizmosSettings

A class in Root.Township, the global namespace.

Global settings asset holding the pooled line and sphere gizmo prefabs, with static helpers to draw debug lines and spheres in the game world. Get it through GlobalSettings<InGameGizmosSettings>.Instance.

Constructors​

MemberWhat it is
InGameGizmosSettings()Use ScriptableObject.CreateInstance instead of new; Unity loads the saved ones from assets.

Fields​

2 private and internal fields
MemberWhat it is
private PooledObjectDefinition lineDefinitionPool definition for the line gizmo prefab used by DrawLine.
private PooledObjectDefinition sphereDefinitionPool definition for the sphere gizmo prefab used by DrawSphere.

Properties​

MemberWhat it is
static Color Color { get; set; }Colour applied to each gizmo when it is taken from the pool. Set it before calling DrawLine or DrawSphere. Defaults to white.

Methods​

MemberWhat it is
static PooledObject DrawLine(Vector3 from, Vector3 to)Takes an InGameLineGizmo from the pool and places it between two world points, or between two transforms with local offsets. Returns it so you can release it.
static PooledObject DrawLine(Transform from, Transform to, Vector3 offsetFrom, Vector3 offsetTo)Takes an InGameLineGizmo from the pool and places it between two world points, or between two transforms with local offsets. Returns it so you can release it.
static PooledObject DrawSphere(Vector3 position, float radius)Takes an InGameSphereGizmo from the pool and places it at a world point, or on a transform with an offset, at the given radius.
static PooledObject DrawSphere(Transform position, float radius, Vector3 offset)Takes an InGameSphereGizmo from the pool and places it at a world point, or on a transform with an offset, at the given radius.