public class Sandbox.Gizmo.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.
Related Guides
Broader workflow and conceptual references connected to this API.
In the event that you find your JSON files growing too much due to too much data. You can store data as a binary blob. This will work with anything that serializes to JSON.
You can define movies and play them back using C#.
A prefab is a GameObject that can be used in multiple places. They're usually used to contain an object that is used across multiple scenes, or needs to be instantiated at runtime.
The number one best way to test multiplayer is to have someone join your game.. but that's obviously not always possible.
Attributes are the bridge to pass information around the CPU to the GPU, like Variables, Textures or entire Buffers.
s&box has a [CodeGenerator] attribute that you can use to decorate another attribute specifically for use with methods and properties. It lets you wrap methods and properties to perform some other action when the method is called or the property is set or to return a different value when the property is read.
Constructors
Showing 1 constructors
public Instance()
No results match this filter.
Methods
Showing 6 methods
public 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.
public virtual sealed void Dispose()
Destroy this instance, clean up any created resources/scene objects, destroy the world.
public 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.
public System.IDisposable Push()
Push this instance as the global Gizmo state. All Gizmo calls during this scope will use this instance.
public 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.
public 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.
No results match this filter.
Properties
Showing 7 properties
public string Sandbox.Gizmo.Instance.ControlMode { get; set; }
The current control mode. This is generally implementation specific. We tend to use "mouse" and "firstperson".
public bool Sandbox.Gizmo.Instance.Debug { get; set; }
If true, we'll draw some debug information
public bool Sandbox.Gizmo.Instance.DebugHitboxes { get; set; }
If true we'll enable hitbox debugging
public Sandbox.Gizmo.Inputs Sandbox.Gizmo.Instance.PreviousInput { get; set; }
The previous input state
public Sandbox.SelectionSystem Sandbox.Gizmo.Instance.Selection { get; set; }
This frame's created (or re-used) objects
public Sandbox.Gizmo.SceneSettings Sandbox.Gizmo.Instance.Settings { get; set; }
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.
public Sandbox.SceneWorld Sandbox.Gizmo.Instance.World { get; set; }
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 (!)
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | global |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.Gizmo.Instance |