Instance
public class Instance Holds the backend state for a Gizmo scope. This allows us to have multiple different gizmo states (for multiple views, multiple windows, game and editor) and push them as the current active state whenever needed.
Constructors
Instance() Properties
| Name | Type | Description |
|---|---|---|
Debug | Boolean | If true, we'll draw some debug information |
DebugHitboxes | Boolean | If true we'll enable hitbox debugging |
World | SceneWorld | The SceneWorld this instance is writing to. This world exists only for this instance. You need to add this world to your camera for it to render (!) |
PreviousInput | Inputs | The previous input state |
Selection | SelectionSystem | This frame's created (or re-used) objects |
ControlMode | String | The current control mode. This is generally implementation specific. We tend to use "mouse" and "firstperson". |
Settings | SceneSettings | Some global settings accessible to the gizmos. Your implementation generally lets your users set up these things to their preference, and the gizmos should try to obey them. |
Methods
T GetValue(String name) Generic storage for whatever you want to do. You're responsible for not spamming into this and cleaning up after yourself.
Void SetValue(String name, T value) Generic storage for whatever you want to do. You're responsible for not spamming into this and cleaning up after yourself.
Void Clear() Called when the scene changes and we don't want to inherit a bunch of values. We might want to just target some specific values here instead of clearing the log.
virtual Void Dispose() Destroy this instance, clean up any created resources/scene objects, destroy the world.
IDisposable Push() Push this instance as the global Gizmo state. All Gizmo calls during this scope will use this instance.
Void StompCursorPosition(Vector2 position) Set all of the state's cursor positions to this value. This stomps previous values which will effectively clear any deltas. This should be used prior to starting a loop.
Fields
| Name | Type | Description |
|---|---|---|
Input | Inputs | Input state. Should be setup before push. |