Files
sbox-public/engine/Launcher/SboxDev/Launcher.cs
s&box team 71f266059a Open source release
This commit imports the C# engine code and game files, excluding C++ source code.

[Source-Commit: ceb3d758046e50faa6258bc3b658a30c97743268]
2025-11-24 09:05:18 +00:00

34 lines
853 B
C#

using System;
using System.Diagnostics;
using System.Linq;
namespace Sandbox;
public static class Launcher
{
public static int Main()
{
if ( !HasCommandLineSwitch( "-project" ) && !HasCommandLineSwitch( "-test" ) )
{
// we pass the command line, so we can pass it on to the sbox-launcher (for -game etc)
ProcessStartInfo info = new ProcessStartInfo( "sbox-launcher.exe", Environment.CommandLine );
info.UseShellExecute = true;
info.CreateNoWindow = true;
info.WorkingDirectory = System.Environment.CurrentDirectory;
Process.Start( info );
return 0;
}
var appSystem = new EditorAppSystem();
appSystem.Run();
return 0;
}
private static bool HasCommandLineSwitch( string switchName )
{
return Environment.GetCommandLineArgs().Any( arg => arg.Equals( switchName, StringComparison.OrdinalIgnoreCase ) );
}
}