From fc2b5b9ae04e3b676f0861c4ed91cd8f92883416 Mon Sep 17 00:00:00 2001
From: Eric Heine <erheine@nps.edu>
Date: Mon, 27 Jan 2020 13:51:01 -0800
Subject: [PATCH] Made a new Util package for shared things with no clearly
 defined system with one script to begin with that quits a Unity application.

---
 Util.meta                    |  8 ++++++++
 Util/ApplicationExit.cs      | 17 +++++++++++++++++
 Util/ApplicationExit.cs.meta | 11 +++++++++++
 Util/Shared.Util.asmdef      | 12 ++++++++++++
 Util/Shared.Util.asmdef.meta |  7 +++++++
 5 files changed, 55 insertions(+)
 create mode 100644 Util.meta
 create mode 100644 Util/ApplicationExit.cs
 create mode 100644 Util/ApplicationExit.cs.meta
 create mode 100644 Util/Shared.Util.asmdef
 create mode 100644 Util/Shared.Util.asmdef.meta

diff --git a/Util.meta b/Util.meta
new file mode 100644
index 0000000..1aa0681
--- /dev/null
+++ b/Util.meta
@@ -0,0 +1,8 @@
+fileFormatVersion: 2
+guid: cb0d4ce98064bd0499ad273cf3b33368
+folderAsset: yes
+DefaultImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Util/ApplicationExit.cs b/Util/ApplicationExit.cs
new file mode 100644
index 0000000..05abdea
--- /dev/null
+++ b/Util/ApplicationExit.cs
@@ -0,0 +1,17 @@
+using UnityEngine;
+
+namespace Shared.Util {
+  // Exits the application when told
+  public class ApplicationExit : MonoBehaviour {
+    // --------------------------------------------------------------------------
+    public void Exit() {
+#if UNITY_EDITOR
+      // Make the Unity Editor stop playing
+      UnityEditor.EditorApplication.isPlaying = false;
+#else
+      // Quit the running Unity application
+      Application.Quit();
+#endif
+    }
+  }
+}
diff --git a/Util/ApplicationExit.cs.meta b/Util/ApplicationExit.cs.meta
new file mode 100644
index 0000000..9db9790
--- /dev/null
+++ b/Util/ApplicationExit.cs.meta
@@ -0,0 +1,11 @@
+fileFormatVersion: 2
+guid: e637f027789c7f54186d7fc99ac125e3
+MonoImporter:
+  externalObjects: {}
+  serializedVersion: 2
+  defaultReferences: []
+  executionOrder: 0
+  icon: {instanceID: 0}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
diff --git a/Util/Shared.Util.asmdef b/Util/Shared.Util.asmdef
new file mode 100644
index 0000000..9478733
--- /dev/null
+++ b/Util/Shared.Util.asmdef
@@ -0,0 +1,12 @@
+{
+    "name": "Shared.Util",
+    "references": [],
+    "optionalUnityReferences": [],
+    "includePlatforms": [],
+    "excludePlatforms": [],
+    "allowUnsafeCode": false,
+    "overrideReferences": false,
+    "precompiledReferences": [],
+    "autoReferenced": true,
+    "defineConstraints": []
+}
\ No newline at end of file
diff --git a/Util/Shared.Util.asmdef.meta b/Util/Shared.Util.asmdef.meta
new file mode 100644
index 0000000..bea4bfd
--- /dev/null
+++ b/Util/Shared.Util.asmdef.meta
@@ -0,0 +1,7 @@
+fileFormatVersion: 2
+guid: 0288e5f631bff9c40aee25083e8fea0d
+AssemblyDefinitionImporter:
+  externalObjects: {}
+  userData: 
+  assetBundleName: 
+  assetBundleVariant: 
-- 
GitLab