MapInstanceclass

Allows you to load a map into the Scene. This can be either a vpk or a scene map.

object→Component→MapInstance
Namespace
Sandbox
Assembly
Sandbox.Engine
Declaration
public class Sandbox.MapInstance : Sandbox.Component

Constructors1

Showing 1 constructors

public MapInstance()PUBLICCONSTRUCTOR

Methods5

Showing 5 methods

protected virtual void OnCreateObject(Sandbox.GameObject go, Sandbox.MapLoader.ObjectEntry kv)PROTECTEDVIRTUAL

Override this to add components to a map object. Only called for map objects that are not implemented.

ParameterTypeDescription
goGameObject—
kvObjectEntry—
Returns:void—

protected virtual System.Threading.Tasks.Task OnLoad(Sandbox.LoadingContext context)PROTECTEDVIRTUAL

ParameterTypeDescription
contextLoadingContext—
Returns:Task—

protected virtual void OnTagsChanged()PROTECTEDVIRTUAL

Returns:void—

protected virtual void OnUpdate()PROTECTEDVIRTUALPER-FRAME

Returns:void—

public void UnloadMap()PUBLIC

Unload the current map.

Returns:void—

Properties9

Showing 9 properties

public BBox Sandbox.MapInstance.Bounds { get; set; }PUBLICGETSET

Get the world bounds of the map

Returns:BBox—

public virtual int Sandbox.MapInstance.ComponentVersion { get; set; }PUBLICVIRTUALGETSET

Returns:int—

public bool Sandbox.MapInstance.EnableCollision { get; set; }PUBLICGETSET

Returns:bool—

public bool Sandbox.MapInstance.IsLoaded { get; set; }PUBLICGETSET

True if the map is loaded

Returns:bool—

public string Sandbox.MapInstance.MapName { get; set; }PUBLICGETSET

Returns:string—

public bool Sandbox.MapInstance.NoOrigin { get; set; }PUBLICGETSET

Returns:bool—

public System.Action Sandbox.MapInstance.OnMapLoaded { get; set; }PUBLICGETSET

Called when the map has successfully loaded

Returns:Action—

public System.Action Sandbox.MapInstance.OnMapUnloaded { get; set; }PUBLICGETSET

Called when the map has been unloaded

Returns:Action—

public bool Sandbox.MapInstance.UseMapFromLaunch { get; set; }PUBLICGETSET

Returns:bool—

On this page