diff options
| author | Andrew Lee <alee14498@protonmail.com> | 2025-08-03 14:44:16 -0400 |
|---|---|---|
| committer | Andrew Lee <alee14498@protonmail.com> | 2025-08-03 14:44:16 -0400 |
| commit | 84b6cb604310399529a695a421a85af700bbb796 (patch) | |
| tree | c9a140ea82511515d812165c7eb6f9d439ac4d58 /Assets/Scripts | |
| parent | 4d0cfd3641c3a5cb7c4bccfbad0476e366324524 (diff) | |
| download | prototype-a-master.tar.gz prototype-a-master.tar.bz2 prototype-a-master.zip | |
Diffstat (limited to 'Assets/Scripts')
| -rw-r--r-- | Assets/Scripts/CineCamera.cs | 11 | ||||
| -rw-r--r-- | Assets/Scripts/DiscordController.cs | 13 | ||||
| -rw-r--r-- | Assets/Scripts/Quit.cs | 21 | ||||
| -rw-r--r-- | Assets/Scripts/Quit.cs.meta | 11 |
4 files changed, 53 insertions, 3 deletions
diff --git a/Assets/Scripts/CineCamera.cs b/Assets/Scripts/CineCamera.cs index 0a38fe3..ff59e11 100644 --- a/Assets/Scripts/CineCamera.cs +++ b/Assets/Scripts/CineCamera.cs @@ -4,6 +4,12 @@ using UnityEngine; public class CineCamera : MonoBehaviour { + public GameObject camera; + public GameObject player; + public Transform cameraPosition; + public GameObject mainCam; + public Transform environment; + // Start is called before the first frame update void Start() { @@ -16,7 +22,10 @@ public class CineCamera : MonoBehaviour //Spawns camera if (Input.GetKeyDown(KeyCode.Mouse0)) { - + camera.transform.SetParent(environment); + cameraPosition.position = player.transform.position; + cameraPosition.rotation = mainCam.transform.rotation; + } //Switches to camera view diff --git a/Assets/Scripts/DiscordController.cs b/Assets/Scripts/DiscordController.cs index 4812df3..c7ce6fa 100644 --- a/Assets/Scripts/DiscordController.cs +++ b/Assets/Scripts/DiscordController.cs @@ -1,4 +1,5 @@ -using UnityEngine;
+using System;
+using UnityEngine;
public class DiscordController : MonoBehaviour
{
@@ -11,7 +12,9 @@ public class DiscordController : MonoBehaviour public string rpcLargeImageText;
// Use this for initialization
- void Start () {
+ void Start ()
+ {
+ Debug.Log("Starting Discord RPC Module");
Discord = new Discord.Discord(applicationID, (System.UInt64)global::Discord.CreateFlags.NoRequireDiscord);
var activityManager = Discord.GetActivityManager();
var activity = new Discord.Activity
@@ -49,4 +52,10 @@ public class DiscordController : MonoBehaviour void Update () {
Discord.RunCallbacks();
}
+
+ private void OnApplicationQuit()
+ {
+ Debug.Log("Stopping Discord RPC Module");
+ Discord.Dispose();
+ }
}
diff --git a/Assets/Scripts/Quit.cs b/Assets/Scripts/Quit.cs new file mode 100644 index 0000000..3faba95 --- /dev/null +++ b/Assets/Scripts/Quit.cs @@ -0,0 +1,21 @@ +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class Quit : MonoBehaviour +{ + // Update is called once per frame + void Update() + { + if (Input.GetKey("escape")) + { +#if UNITY_STANDALONE + Application.Quit(); +#endif + /* +#if UNITY_EDITOR + UnityEditor.EditorApplication.isPlaying = false; +#endif*/ + } + } +} diff --git a/Assets/Scripts/Quit.cs.meta b/Assets/Scripts/Quit.cs.meta new file mode 100644 index 0000000..cca53e2 --- /dev/null +++ b/Assets/Scripts/Quit.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 695245e21df365748859a26bddd6d555 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: |
