mirror of
https://github.com/Facepunch/sbox-public.git
synced 2026-01-05 04:48:19 -05:00
This commit imports the C# engine code and game files, excluding C++ source code. [Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
43 lines
1000 B
C#
43 lines
1000 B
C#
namespace Sandbox;
|
|
|
|
public class SceneLoadOptions
|
|
{
|
|
SceneFile scene;
|
|
|
|
/// <summary>
|
|
/// Internal property to mark this scene as being a system scene. It should only be set in
|
|
/// <see cref="Scene.AddSystemScene"/>.
|
|
/// </summary>
|
|
internal bool IsSystemScene { get; set; }
|
|
|
|
public bool ShowLoadingScreen { get; set; } = true;
|
|
public bool IsAdditive { get; set; } = false;
|
|
|
|
/// <summary>
|
|
/// If true, on load we'll even delete objects that are marked as DontDelete
|
|
/// </summary>
|
|
public bool DeleteEverything { get; set; } = false;
|
|
public Transform Offset { get; set; } = Transform.Zero;
|
|
|
|
public SceneFile GetSceneFile() => scene;
|
|
|
|
public bool SetScene( SceneFile sceneFile )
|
|
{
|
|
scene = sceneFile;
|
|
return true;
|
|
}
|
|
|
|
public bool SetScene( string sceneFileName )
|
|
{
|
|
var file = ResourceLibrary.Get<SceneFile>( sceneFileName );
|
|
if ( file is null )
|
|
{
|
|
Log.Warning( $"LoadFromFile: Couldn't find {sceneFileName}" );
|
|
return false;
|
|
}
|
|
|
|
SetScene( file );
|
|
return true;
|
|
}
|
|
}
|