Browse Source

- Added the option to shut down a UniQuake instance from outside of Quake itself. Useful for when Quake is running headless.

- Added shader variant collection to allow use of the URP simple lit shader in a standalone build
console
Nico de Poel 5 years ago
parent
commit
0978e0490e
  1. 13
      Assets/Rendering/QuakeShaderVariants.shadervariants
  2. 8
      Assets/Rendering/QuakeShaderVariants.shadervariants.meta
  3. 14
      Assets/Scripts/Bootstrap.cs
  4. 2
      Assets/Scripts/UniQuake.cs
  5. 3
      ProjectSettings/GraphicsSettings.asset

13
Assets/Rendering/QuakeShaderVariants.shadervariants

@ -0,0 +1,13 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!200 &20000000
ShaderVariantCollection:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: QuakeShaderVariants
m_Shaders:
- first: {fileID: 4800000, guid: 8d2bb70cbf9db8d4da26e15b26e74248, type: 3}
second:
variants: []

8
Assets/Rendering/QuakeShaderVariants.shadervariants.meta

@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 0bce72ddc4b3a52428a360db52c20c96
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 20000000
userData:
assetBundleName:
assetBundleVariant:

14
Assets/Scripts/Bootstrap.cs

@ -8,6 +8,8 @@ public class Bootstrap : MonoBehaviour
private string mod; private string mod;
private float speed = 1.0f; private float speed = 1.0f;
private UniQuake uq;
private void Start() private void Start()
{ {
Debug.Log($"Running in {IntPtr.Size * 8}-bit mode"); Debug.Log($"Running in {IntPtr.Size * 8}-bit mode");
@ -17,21 +19,21 @@ public class Bootstrap : MonoBehaviour
{ {
if (GUILayout.Button("Start Quake!")) if (GUILayout.Button("Start Quake!"))
{ {
var uq = gameObject.AddComponent<UniQuake>();
uq = gameObject.AddComponent<UniQuake>();
uq.BaseGame = MissionPack.Quake; uq.BaseGame = MissionPack.Quake;
uq.ModDirectory = mod; uq.ModDirectory = mod;
} }
if (GUILayout.Button("Start Scourge of Armagon!")) if (GUILayout.Button("Start Scourge of Armagon!"))
{ {
var uq = gameObject.AddComponent<UniQuake>();
uq = gameObject.AddComponent<UniQuake>();
uq.BaseGame = MissionPack.Hipnotic; uq.BaseGame = MissionPack.Hipnotic;
uq.ModDirectory = mod; uq.ModDirectory = mod;
} }
if (GUILayout.Button("Start Dissolution of Eternity!")) if (GUILayout.Button("Start Dissolution of Eternity!"))
{ {
var uq = gameObject.AddComponent<UniQuake>();
uq = gameObject.AddComponent<UniQuake>();
uq.BaseGame = MissionPack.Rogue; uq.BaseGame = MissionPack.Rogue;
uq.ModDirectory = mod; uq.ModDirectory = mod;
} }
@ -46,5 +48,11 @@ public class Bootstrap : MonoBehaviour
{ {
Time.timeScale = speed; Time.timeScale = speed;
} }
if (uq != null && GUILayout.Button("Quit!"))
{
uq.Shutdown();
uq = null;
}
} }
} }

2
Assets/Scripts/UniQuake.cs

@ -127,7 +127,7 @@ public partial class UniQuake: MonoBehaviour
FlushLog(); FlushLog();
} }
private void Shutdown()
public void Shutdown()
{ {
initialized = false; initialized = false;
UniQuake_Shutdown(); UniQuake_Shutdown();

3
ProjectSettings/GraphicsSettings.asset

@ -36,7 +36,8 @@ GraphicsSettings:
- {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 15106, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10753, guid: 0000000000000000f000000000000000, type: 0}
- {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0} - {fileID: 10770, guid: 0000000000000000f000000000000000, type: 0}
m_PreloadedShaders: []
m_PreloadedShaders:
- {fileID: 20000000, guid: 0bce72ddc4b3a52428a360db52c20c96, type: 2}
m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000, m_SpritesDefaultMaterial: {fileID: 10754, guid: 0000000000000000f000000000000000,
type: 0} type: 0}
m_CustomRenderPipeline: {fileID: 11400000, guid: c24e2c2de0e0d4d4ba09c317ce83dea9, m_CustomRenderPipeline: {fileID: 11400000, guid: c24e2c2de0e0d4d4ba09c317ce83dea9,

Loading…
Cancel
Save