using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class Bootstrap : MonoBehaviour { private string mod, args; private float speed = 1.0f; private UniQuake uq; private void Start() { Debug.Log($"Running in {IntPtr.Size * 8}-bit mode"); } private void OnGUI() { if (GUILayout.Button("Start Quake!")) { uq = gameObject.AddComponent(); uq.BaseGame = MissionPack.Quake; uq.ModDirectory = mod; uq.AdditionalArguments = ParseArgs(); uq.Camera = Camera.main; // This can be any one of four cameras for split-screen, each with its own culling layer } if (GUILayout.Button("Start Scourge of Armagon!")) { uq = gameObject.AddComponent(); uq.BaseGame = MissionPack.Hipnotic; uq.ModDirectory = mod; uq.AdditionalArguments = ParseArgs(); uq.Camera = Camera.main; } if (GUILayout.Button("Start Dissolution of Eternity!")) { uq = gameObject.AddComponent(); uq.BaseGame = MissionPack.Rogue; uq.ModDirectory = mod; uq.AdditionalArguments = ParseArgs(); uq.Camera = Camera.main; } GUILayout.Label("Mod directory:"); mod = GUILayout.TextField(mod); GUILayout.Label("Additional arguments:"); args = GUILayout.TextField(args); GUILayout.Label("Time scale:"); speed = GUILayout.HorizontalSlider(speed, 0.1f, 5.0f, GUILayout.Width(250)); GUILayout.Label($"{speed:0.00}"); if (!Mathf.Approximately(speed, Time.timeScale)) { Time.timeScale = speed; } if (uq != null && GUILayout.Button("Quit!")) { uq.Shutdown(); uq = null; } } private string[] ParseArgs() { if (args == null) return new string[0]; return args.Split(new[] {' ', '\t', '\r', '\n'}, StringSplitOptions.RemoveEmptyEntries); } }