public class Sandbox.Scene : Sandbox.GameObject
Related Guides
Broader workflow and conceptual references connected to this API.
If you want a specific file/asset type to have a custom Thumbnail/Inspector Preview, you can simply create an AssetPreview. An AssetPreview initializes a SceneWorld and SceneCamera, rendering the Camera to the Preview output, so all you need to do is populate it and/or position the Camera to your liking.
Sometimes you know what you're looking for, but you don't know where it is.
There are various interfaces that can be given to components for specific purposes.
A Component is added to a GameObject to provide functionality. This functionality can vary wildly.
The mount system is extensible - anyone can write a mount to add support for a new game or engine and contribute it to s&box via pull request. A mount detects a game's install directory via Steam, scans its files, and converts assets into s&box compatible assets, all at runtime.
Editor Events are events that are broadcast globally throughout the editor and can be listened to/fired from any Editor Project. These are useful for creating your own custom Editor Tools and making sure they can work in tandem with existing systems.
Constructors
Showing 2 constructors
No results match this filter.
Methods
Showing 34 methods
public System.IDisposable AddHook(Sandbox.GameObjectSystem.Stage stage, int order, System.Action action, string className, string description)
Call this method on this stage. This returns a disposable that will remove the hook when disposed.
public System.IDisposable BatchGroup()
Collects anything inside into a batch group. A batchgroup is used with GameObject and Components to make sure that their OnEnable/OnDisable and other callbacks are called in a deterministic order, and that they can find each other during creation. `Sandbox.GameObject.NetworkSpawn` calls will also be batched.
public void ClearUnsavedChanges()Obsolete
Obsolete: This API member is obsolete.
public static Sandbox.Scene CreateEditorScene()
public Sandbox.GameObject CreateObject(bool enabled = True)
Create a GameObject on this scene. This doesn't require the scene to be the active scene.
Parameters
enabled: Default: True
public virtual void Deserialize(System.Text.Json.Nodes.JsonObject node, Sandbox.GameObject.DeserializeOptions option)
public virtual void Destroy()
Destroy this scene. After this you should never use it again.
public void EditorDraw()
public void EditorTick(float timeNow, float timeDelta)
protected virtual override void Finalize()
public System.Collections.Generic.IEnumerable`1<Sandbox.GameObject> FindAllWithTag(string tag)
Find objects with tag
public System.Collections.Generic.IEnumerable`1<Sandbox.GameObject> FindAllWithTags(System.Collections.Generic.IEnumerable`1<string> tags)
public void GameTick(double timeDelta = 0.1)
Parameters
timeDelta: Default: 0.1
public T Get()
Gets the first object found of this type. This could be a component or a GameObjectSystem, or other stuff in the future.
public bool IsBBoxVisibleToConnection(Sandbox.Connection target, BBox box)
Are these bounds visible to the specified `Sandbox.Connection`?
public bool IsPointVisibleToConnection(Sandbox.Connection target, Vector3 position)
Is a position visible to the specified `Sandbox.Connection`?
public bool LoadFromFile(string filename)
Load from the provided file name. This will not load the scene for other clients in a multiplayer session, you should instead use `Sandbox.Game.ChangeScene(Sandbox.SceneLoadOptions)` if you want to bring other clients.
public void ProcessDeletes()
Delete any GameObjects waiting to be deleted
public System.IDisposable Push()
Push this scene as the active scene, for a scope
public virtual void RunEvent(System.Action`1<T> action, Sandbox.FindMode find = 69)
Parameters
find: Default: 69
public virtual System.Text.Json.Nodes.JsonObject Serialize(Sandbox.GameObject.SerializeOptions options = null)
Parameters
options: Default: null
public System.Text.Json.Nodes.JsonObject SerializeProperties()
public void StartLoading()
No results match this filter.
Properties
Showing 29 properties
public static System.Collections.Generic.IEnumerable`1<Sandbox.Scene> Sandbox.Scene.All { get; set; }
All active non-editor scenes.
public Sandbox.CameraComponent Sandbox.Scene.Camera { get; set; }
public Sandbox.SceneWorld Sandbox.Scene.DebugSceneWorld { get; set; }
public string Sandbox.Scene.Description { get; set; }Obsolete
Obsolete: please use the SceneInformation component
public Sandbox.GameObjectDirectory Sandbox.Scene.Directory { get; set; }
public Sandbox.Scene.ISceneEditorSession Sandbox.Scene.Editor { get; set; }
Allows access to the scene's editor session from the game. This will be null if there is no editor session active on this scene.
public float Sandbox.Scene.FixedDelta { get; set; }
public float Sandbox.Scene.FixedUpdateFrequency { get; set; }Obsolete
Obsolete: Moved to Sandbox.ProjectSettings.PhysicsSettings
public bool Sandbox.Scene.HasUnsavedChanges { get; set; }Obsolete
Obsolete: Use Scene.Editor.HasUnsavedChanges
public bool Sandbox.Scene.IsEditor { get; set; }
public bool Sandbox.Scene.IsFixedUpdate { get; set; }
public bool Sandbox.Scene.IsLoading { get; set; }
Return true if we're in an initial loading phase
public virtual bool Sandbox.Scene.IsValid { get; set; }
Returns true if this scene has not been destroyed
public int Sandbox.Scene.MaxFixedUpdates { get; set; }Obsolete
Obsolete: Moved to Sandbox.ProjectSettings.PhysicsSettings
public float Sandbox.Scene.NetworkFrequency { get; set; }Obsolete
Obsolete: Moved to ProjectSettings.Networking.UpdateRate
public float Sandbox.Scene.NetworkRate { get; set; }
One divided by ProjectSettings.Networking.UpdateRate.
public int Sandbox.Scene.PhysicsSubSteps { get; set; }Obsolete
Obsolete: Moved to Sandbox.ProjectSettings.PhysicsSettings
public Sandbox.PhysicsWorld Sandbox.Scene.PhysicsWorld { get; set; }
public Sandbox.RenderAttributes Sandbox.Scene.RenderAttributes { get; set; }
Global render attributes accessible on any renderable in this Scene.
public Sandbox.SceneWorld Sandbox.Scene.SceneWorld { get; set; }
public Sandbox.GameResource Sandbox.Scene.Source { get; set; }
public bool Sandbox.Scene.ThreadedAnimation { get; set; }Obsolete
Obsolete: Unused. Animation is always threaded.
public float Sandbox.Scene.TimeScale { get; set; }
public string Sandbox.Scene.Title { get; set; }Obsolete
Obsolete: please use the SceneInformation component
public Sandbox.SceneTrace Sandbox.Scene.Trace { get; set; }
public bool Sandbox.Scene.UseFixedUpdate { get; set; }Obsolete
Obsolete: Moved to Sandbox.ProjectSettings.PhysicsSettings
public Sandbox.Volumes.VolumeSystem Sandbox.Scene.Volumes { get; set; }
Allows quickly finding components that have a volume
public bool Sandbox.Scene.WantsSystemScene { get; set; }
If true we'll additive load the system scene when this scene is loaded. Defaults to true. You might want to disable this for specific scenes, like menu scenes etc.
No results match this filter.
Metadata
| Field | Value |
|---|---|
| Namespace | Sandbox |
| Type | class |
| Assembly | Sandbox.Engine |
| Doc ID | T:Sandbox.Scene |