Files
grass-cutters/Assets/Scripts/Core/GameBoot.cs
NiemandKG d1c3761e58 Grass Cutters Together: the project as of moon-sweepers f3666f0
A clean start for the shared repository: the Unity project (Assets, Packages, ProjectSettings), ArtSource, Docs and
Tools as they stood at f3666f0 in the old local repository, with its generated prefabs and scene brought up to date.
Images, audio, models and binaries go through Git LFS (.gitattributes).

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-06 18:44:40 +06:00

29 lines
1.3 KiB
C#

using UnityEngine;
namespace GrassCutter
{
/// <summary>Scene entry point: warms up singletons and configures physics layers.</summary>
public class GameBoot : MonoBehaviour
{
void Awake()
{
Application.targetFrameRate = -1;
Layers.SetupCollisions();
Fx.Warmup();
_ = Sfx.I;
GameSettings.Apply();
if (CommandLine.Has("-resetsave")) { TeamState.DeleteSave(); Debug.Log("[Boot] save reset"); }
foreach (var d in UnityEngine.InputSystem.InputSystem.devices) Debug.Log($"[Input] device: {d.name} ({d.layout}) {d.description.product}");
}
void Start()
{
// dev bots render off-screen so they can run with -batchmode without touching the user's desktop
if (CommandLine.Has("-screenshot") || CommandLine.Has("-autodemo"))
BotCapture.Setup(int.TryParse(CommandLine.Get("-shotw", "1600"), out var w) ? w : 1600, int.TryParse(CommandLine.Get("-shoth", "900"), out var h) ? h : 900);
if (CommandLine.Get("-screenshot") is string path) gameObject.AddComponent<AutoScreenshot>().path = path;
if (CommandLine.Get("-autodemo") is string demo) gameObject.AddComponent<DemoBot>().folder = demo;
}
}
}