You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
81 lines
2.4 KiB
81 lines
2.4 KiB
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;
|
|
|
|
[SerializeField]
|
|
private List<VisualStyle> visualStyles = new List<VisualStyle>();
|
|
|
|
private void Start()
|
|
{
|
|
Debug.Log($"Running in {IntPtr.Size * 8}-bit mode");
|
|
}
|
|
|
|
private void OnGUI()
|
|
{
|
|
if (GUILayout.Button("Start Quake!"))
|
|
{
|
|
uq = gameObject.AddComponent<UniQuake>();
|
|
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
|
|
uq.SetVisualStyle(visualStyles[0]);
|
|
}
|
|
|
|
if (GUILayout.Button("Start Scourge of Armagon!"))
|
|
{
|
|
uq = gameObject.AddComponent<UniQuake>();
|
|
uq.BaseGame = MissionPack.Hipnotic;
|
|
uq.ModDirectory = mod;
|
|
uq.AdditionalArguments = ParseArgs();
|
|
uq.Camera = Camera.main;
|
|
uq.SetVisualStyle(visualStyles[0]);
|
|
}
|
|
|
|
if (GUILayout.Button("Start Dissolution of Eternity!"))
|
|
{
|
|
uq = gameObject.AddComponent<UniQuake>();
|
|
uq.BaseGame = MissionPack.Rogue;
|
|
uq.ModDirectory = mod;
|
|
uq.AdditionalArguments = ParseArgs();
|
|
uq.Camera = Camera.main;
|
|
uq.SetVisualStyle(visualStyles[0]);
|
|
}
|
|
|
|
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);
|
|
}
|
|
}
|