s&box docs

public class Sandbox.Scene : Sandbox.GameObject

Broader workflow and conceptual references connected to this API.

Constructors

Showing 2 constructors

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 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 System.Text.Json.Nodes.JsonObject SerializeProperties()

public void StartLoading()

Properties

Showing 29 properties

public static System.Collections.Generic.IEnumerable`1<Sandbox.Scene> Sandbox.Scene.All { get; set; }

All active non-editor scenes.

public string Sandbox.Scene.Description { get; set; }Obsolete

Obsolete: please use the SceneInformation component

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 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 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.

Metadata

FieldValue
NamespaceSandbox
Typeclass
AssemblySandbox.Engine
Doc IDT:Sandbox.Scene

On this page

Constructorspublic Scene()protected Scene(System.Boolean isEditor)Methodspublic System.IDisposable AddHook(Sandbox.GameObjectSystem.Stage stage, System.Int32 order, System.Action action, System.String className, System.String description)public System.IDisposable BatchGroup()public System.Void ClearUnsavedChanges()public static Sandbox.Scene CreateEditorScene()public Sandbox.GameObject CreateObject(System.Boolean enabled = True)public virtual System.Void Deserialize(System.Text.Json.Nodes.JsonObject node, Sandbox.GameObject.DeserializeOptions option)public virtual System.Void Destroy()public System.Void EditorDraw()public System.Void EditorTick(System.Single timeNow, System.Single timeDelta)protected virtual override System.Void Finalize()public System.Collections.Generic.IEnumerable`1<Sandbox.GameObject> FindAllWithTag(System.String tag)public System.Collections.Generic.IEnumerable`1<Sandbox.GameObject> FindAllWithTags(System.Collections.Generic.IEnumerable`1<System.String> tags)public System.Collections.Generic.IEnumerable`1<Sandbox.GameObject> FindInPhysics(BBox box)public System.Collections.Generic.IEnumerable`1<Sandbox.GameObject> FindInPhysics(Sandbox.Frustum frustum)public System.Collections.Generic.IEnumerable`1<Sandbox.GameObject> FindInPhysics(Sandbox.Sphere sphere)public System.Void GameTick(System.Double timeDelta = 0.1)public T Get()public System.Collections.Generic.IEnumerable`1<T> GetAll()public System.Void GetAll(System.Collections.Generic.List`1<T> target)public System.Collections.Generic.IEnumerable`1<Sandbox.Component> GetAllComponents(System.Type type)public System.Collections.Generic.IEnumerable`1<T> GetAllComponents()public T GetSystem()public System.Void GetSystem(T val)public System.Boolean IsBBoxVisibleToConnection(Sandbox.Connection target, BBox box)public System.Boolean IsPointVisibleToConnection(Sandbox.Connection target, Vector3 position)public virtual System.Boolean Load(Sandbox.GameResource resource)public System.Boolean Load(Sandbox.SceneLoadOptions options)public System.Boolean LoadFromFile(System.String filename)public System.Void ProcessDeletes()public System.IDisposable Push()public virtual System.Void RunEvent(System.Action`1<T> action, Sandbox.FindMode find = 69)public virtual System.Text.Json.Nodes.JsonObject Serialize(Sandbox.GameObject.SerializeOptions options = null)public System.Text.Json.Nodes.JsonObject SerializeProperties()public System.Void StartLoading()Propertiespublic static System.Collections.Generic.IEnumerable`1<Sandbox.Scene> Sandbox.Scene.All { get; set; }public Sandbox.CameraComponent Sandbox.Scene.Camera { get; set; }public Sandbox.SceneWorld Sandbox.Scene.DebugSceneWorld { get; set; }public System.String Sandbox.Scene.Description { get; set; }public Sandbox.GameObjectDirectory Sandbox.Scene.Directory { get; set; }public Sandbox.Scene.ISceneEditorSession Sandbox.Scene.Editor { get; set; }public System.Single Sandbox.Scene.FixedDelta { get; set; }public System.Single Sandbox.Scene.FixedUpdateFrequency { get; set; }public System.Boolean Sandbox.Scene.HasUnsavedChanges { get; set; }public System.Boolean Sandbox.Scene.IsEditor { get; set; }public System.Boolean Sandbox.Scene.IsFixedUpdate { get; set; }public System.Boolean Sandbox.Scene.IsLoading { get; set; }public virtual System.Boolean Sandbox.Scene.IsValid { get; set; }public System.Int32 Sandbox.Scene.MaxFixedUpdates { get; set; }public Sandbox.Navigation.NavMesh Sandbox.Scene.NavMesh { get; set; }public System.Single Sandbox.Scene.NetworkFrequency { get; set; }public System.Single Sandbox.Scene.NetworkRate { get; set; }public System.Int32 Sandbox.Scene.PhysicsSubSteps { get; set; }public Sandbox.PhysicsWorld Sandbox.Scene.PhysicsWorld { get; set; }public Sandbox.RenderAttributes Sandbox.Scene.RenderAttributes { get; set; }public Sandbox.SceneWorld Sandbox.Scene.SceneWorld { get; set; }public Sandbox.GameResource Sandbox.Scene.Source { get; set; }public System.Boolean Sandbox.Scene.ThreadedAnimation { get; set; }public System.Single Sandbox.Scene.TimeScale { get; set; }public System.String Sandbox.Scene.Title { get; set; }public Sandbox.SceneTrace Sandbox.Scene.Trace { get; set; }public System.Boolean Sandbox.Scene.UseFixedUpdate { get; set; }public Sandbox.Volumes.VolumeSystem Sandbox.Scene.Volumes { get; set; }public System.Boolean Sandbox.Scene.WantsSystemScene { get; set; }Metadata