From 9319ed38d09e4002f6ed37ea2010cdb27dd9ba31 Mon Sep 17 00:00:00 2001 From: billc27 <110593711+billc27@users.noreply.github.com> Date: Thu, 9 May 2024 19:46:40 +0700 Subject: [PATCH] chore: delete unused code --- Assets/Scripts/Managers/CheatManager.cs | 34 ---------------- Assets/Scripts/States/GlobalStateManager.cs | 40 ------------------- .../Scripts/States/GlobalStateManager.cs.meta | 11 ----- Assets/Scripts/States/SaveState.cs | 37 ----------------- Assets/Scripts/States/SaveState.cs.meta | 11 ----- 5 files changed, 133 deletions(-) delete mode 100644 Assets/Scripts/States/GlobalStateManager.cs delete mode 100644 Assets/Scripts/States/GlobalStateManager.cs.meta delete mode 100644 Assets/Scripts/States/SaveState.cs delete mode 100644 Assets/Scripts/States/SaveState.cs.meta diff --git a/Assets/Scripts/Managers/CheatManager.cs b/Assets/Scripts/Managers/CheatManager.cs index 5be3424..42f216d 100644 --- a/Assets/Scripts/Managers/CheatManager.cs +++ b/Assets/Scripts/Managers/CheatManager.cs @@ -17,21 +17,6 @@ using UnityEngine.Windows; * SKIPLEVEL : Player skips 1 level */ - -/* CHEATS THAT CAN BE SAVED */ -/* - * NODAMAGE - * ONEHITKILL - * XTWOSPEED - */ - -public enum CheatsType -{ - NODAMAGE, - ONEHITKILL, - XTWOSPEED -} - public class CheatManager : MonoBehaviour { HUDisplay hud; @@ -152,14 +137,12 @@ public class CheatManager : MonoBehaviour { playerHealth.SetCheatNoDamage(true); hud.OpenPanel("No Damage Cheat Activated!"); - cheats[(int)CheatsType.NODAMAGE] = true; } private void ActivateOneHitKill() { playerShooting.ActivateCheatOneHitKill(); hud.OpenPanel("One Hit Kill Cheat Activated!"); - cheats[(int)CheatsType.ONEHITKILL] = true; } private void ActivateMotherlode() @@ -172,7 +155,6 @@ public class CheatManager : MonoBehaviour { playerMovement.ActivateCheatXTwoSpeed(); hud.OpenPanel("Two Times Speed Cheat Activated!"); - cheats[(int)CheatsType.XTWOSPEED] = true; } private void ActivateFullHPPet() @@ -264,20 +246,4 @@ public class CheatManager : MonoBehaviour hud.OpenPanel("Successfully Reset Cheat(s)!"); } - - public void LoadCheat(bool[] gatheredCheats) - { - if (gatheredCheats[(int)CheatsType.NODAMAGE]) - { - ActivateNoDamage(); - } - if (gatheredCheats[(int)CheatsType.ONEHITKILL]) - { - ActivateOneHitKill(); - } - if (gatheredCheats[(int)CheatsType.XTWOSPEED]) - { - ActivateXTwoSpeed(); - } - } } diff --git a/Assets/Scripts/States/GlobalStateManager.cs b/Assets/Scripts/States/GlobalStateManager.cs deleted file mode 100644 index a0d815d..0000000 --- a/Assets/Scripts/States/GlobalStateManager.cs +++ /dev/null @@ -1,40 +0,0 @@ -using Nightmare; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -public class GlobalStateManager : MonoBehaviour -{ - // Create Singleton - public static GlobalStateManager Instance { get; private set; } - - private CheatManager cheatManager; - - private void Awake() - { - if (Instance != null) - { - if (Instance != this) - { - Destroy(this); - } - } - else - { - Instance = this; - Refresh(); - } - } - - private void Refresh() - { - cheatManager = FindObjectOfType<CheatManager>(); - } - - public void SetState(SaveState state) - { - Refresh(); - - cheatManager.LoadCheat(state.globalSaveState.cheats); - } -} diff --git a/Assets/Scripts/States/GlobalStateManager.cs.meta b/Assets/Scripts/States/GlobalStateManager.cs.meta deleted file mode 100644 index 5b855cc..0000000 --- a/Assets/Scripts/States/GlobalStateManager.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: 40f7e905f1aa63741b02b9146e251f76 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: diff --git a/Assets/Scripts/States/SaveState.cs b/Assets/Scripts/States/SaveState.cs deleted file mode 100644 index da0b873..0000000 --- a/Assets/Scripts/States/SaveState.cs +++ /dev/null @@ -1,37 +0,0 @@ -using System; -using Newtonsoft.Json; -using System.Collections; -using System.Collections.Generic; -using UnityEngine; - -[Serializable] -public class GlobalSaveState -{ - public bool[] cheats; - - public GlobalSaveState(bool[] cheats) - { - this.cheats = cheats; - } - - public override string ToString() - { - return JsonConvert.SerializeObject(this); - } -} - -[Serializable] -public class SaveState -{ - public GlobalSaveState globalSaveState; - - public SaveState(GlobalSaveState globalSaveState) - { - this.globalSaveState = globalSaveState; - } - - public override string ToString() - { - return JsonConvert.SerializeObject(this); - } -} diff --git a/Assets/Scripts/States/SaveState.cs.meta b/Assets/Scripts/States/SaveState.cs.meta deleted file mode 100644 index a0c00a3..0000000 --- a/Assets/Scripts/States/SaveState.cs.meta +++ /dev/null @@ -1,11 +0,0 @@ -fileFormatVersion: 2 -guid: e0c4e2ce428b7c044baefcfca6687111 -MonoImporter: - externalObjects: {} - serializedVersion: 2 - defaultReferences: [] - executionOrder: 0 - icon: {instanceID: 0} - userData: - assetBundleName: - assetBundleVariant: -- GitLab