Api Sandbox Scene
class

Scene

public class Scene : GameObject

Constructors

Scene()

Properties

Name Type Description
Camera CameraComponent
IsEditor Boolean
SceneWorld SceneWorld
DebugSceneWorld SceneWorld
HasUnsavedChanges Boolean
Source GameResource
Directory GameObjectDirectory
Title String
Description String
WantsSystemScene Boolean 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.
RenderAttributes RenderAttributes Global render attributes accessible on any renderable in this Scene.
PhysicsWorld PhysicsWorld
IsValid virtual Boolean Returns true if this scene has not been destroyed
Volumes VolumeSystem Allows quickly finding components that have a volume
Editor ISceneEditorSession 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.
IsLoading Boolean Return true if we're in an initial loading phase
NavMesh NavMesh
NetworkFrequency Single
NetworkRate Single One divided by ProjectSettings.Networking.UpdateRate.
All static IEnumerable<Scene> All active non-editor scenes.
IsFixedUpdate Boolean
FixedDelta Single
FixedUpdateFrequency Single
MaxFixedUpdates Int32
PhysicsSubSteps Int32
ThreadedAnimation Boolean
UseFixedUpdate Boolean
TimeScale Single
Trace SceneTrace

Methods

IEnumerable<T> GetAllComponents()

Get all components of type. This can include interfaces. This function can only find enabled/active components.

IEnumerable<Component> GetAllComponents(Type type)

Get all components of type. This can include interfaces. This function can only find enabled/active components.

virtual Void Destroy()

Destroy this scene. After this you should never use it again.

static Scene CreateEditorScene()
GameObject CreateObject(Boolean enabled = True)

Create a GameObject on this scene. This doesn't require the scene to be the active scene.

IDisposable Push()

Push this scene as the active scene, for a scope

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. NetworkSpawn calls will also be batched.

Void ClearUnsavedChanges()
IEnumerable<GameObject> FindAllWithTags(IEnumerable<String> tags)
IEnumerable<GameObject> FindAllWithTag(String tag)

Find objects with tag

Void ProcessDeletes()

Delete any GameObjects waiting to be deleted

virtual Void RunEvent(Action<T> action, FindMode find = 69)
Void StartLoading()
virtual Boolean Load(GameResource resource)

Load from the provided SceneFile. This will not load the scene for other clients in a multiplayer session, you should instead use SceneLoadOptions) if you want to bring other clients.

Boolean Load(SceneLoadOptions options)

Load from the provided SceneLoadOptions. This will not load the scene for other clients in a multiplayer session, you should instead use SceneLoadOptions) if you want to bring other clients.

Boolean 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 SceneLoadOptions) if you want to bring other clients.

virtual JsonObject Serialize(SerializeOptions options = null)
virtual Void Deserialize(JsonObject node, DeserializeOptions option)
JsonObject SerializeProperties()
Boolean IsBBoxVisibleToConnection(Connection target, BBox box)

Are these bounds visible to the specified Connection?

Boolean IsPointVisibleToConnection(Connection target, Vector3 position)

Is a position visible to the specified Connection?

IEnumerable<T> GetAll()

Get all objects of this type. This could be a component or a GameObjectSystem, or other stuff in the future.

Void GetAll(List<T> target)
T Get()

Gets the first object found of this type. This could be a component or a GameObjectSystem, or other stuff in the future.

IDisposable AddHook(Stage stage, Int32 order, Action action, String className, String description)

Call this method on this stage. This returns a disposable that will remove the hook when disposed.

T GetSystem()

Get a specific system by type.

Void GetSystem(T val)

Get a specific system by type.

Void EditorTick(Single timeNow, Single timeDelta)
Void EditorDraw()
Void GameTick(Double timeDelta = 0.1)
IEnumerable<GameObject> FindInPhysics(Sphere sphere)

Find game objects in a sphere using physics.

IEnumerable<GameObject> FindInPhysics(BBox box)

Find game objects in a box using physics.

IEnumerable<GameObject> FindInPhysics(Frustum frustum)

Find game objects in a frustum using physics.

Assembly: Sandbox.Engine Namespace: Sandbox Full Name: Sandbox.Scene