From 37bae636efed2f0d1a5af06bdb22acaa2c3d4edf Mon Sep 17 00:00:00 2001 From: maikeljh <mjh191003@gmail.com> Date: Sat, 11 May 2024 09:29:51 +0700 Subject: [PATCH] [Fix] Remove all debug logs --- Assets/Resources/MasterMixer.mixer | 2 +- Assets/Scenes/MainMenu.unity | 10 ++++++---- Assets/Scripts/DataUtils/FileDataHandler.cs | 20 ++++--------------- Assets/Scripts/MainMenu/MainMenu.cs | 1 - Assets/Scripts/MainMenu/SaveMenuSafeHouse.cs | 2 -- Assets/Scripts/MainMenu/SaveSlotsMenu.cs | 3 --- .../Managers/DataPersistenceManager.cs | 12 ----------- Assets/Scripts/Managers/LevelManager.cs | 4 ---- Assets/Scripts/Managers/StatsManager.cs | 1 - Assets/Scripts/Pet/BuffMovement.cs | 5 ----- Assets/Scripts/Pet/GoodPetHealth.cs | 1 - Assets/Scripts/Player/PlayerHealth.cs | 1 - Assets/Scripts/Weapons/SwordSwing.cs | 1 - 13 files changed, 11 insertions(+), 52 deletions(-) diff --git a/Assets/Resources/MasterMixer.mixer b/Assets/Resources/MasterMixer.mixer index be1d2a0..a84efb5 100644 --- a/Assets/Resources/MasterMixer.mixer +++ b/Assets/Resources/MasterMixer.mixer @@ -14,7 +14,7 @@ AudioMixerController: - {fileID: 24500000} m_StartSnapshot: {fileID: 24500003} m_SuspendThreshold: -80 - m_EnableSuspend: 1 + m_EnableSuspend: 0 m_UpdateMode: 0 m_ExposedParameters: - guid: 4aa8bd7817000453e95180932afbdae1 diff --git a/Assets/Scenes/MainMenu.unity b/Assets/Scenes/MainMenu.unity index ad68126..f07fc59 100644 --- a/Assets/Scenes/MainMenu.unity +++ b/Assets/Scenes/MainMenu.unity @@ -1029,7 +1029,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 0.000030517578, y: 0.000030517578} + m_AnchoredPosition: {x: 0, y: 0.000030517578} m_SizeDelta: {x: 8.75, y: 13} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &185843954 @@ -1257,6 +1257,7 @@ MonoBehaviour: announcementText: {fileID: 0} enemyManager: [] questText: {fileID: 0} + isCinematic: 0 kerocoKilled: 0 kepalaKerocoKilled: 0 jendralKilled: 0 @@ -1270,6 +1271,7 @@ MonoBehaviour: saveHouse: {fileID: 0} instructionManager: {fileID: 0} skipQuest: 0 + safe: 1 --- !u!4 &309830954 Transform: m_ObjectHideFlags: 0 @@ -4682,10 +4684,10 @@ MonoBehaviour: m_FillRect: {fileID: 677464596} m_HandleRect: {fileID: 1984857994} m_Direction: 0 - m_MinValue: -80 - m_MaxValue: -20 + m_MinValue: -60 + m_MaxValue: 0 m_WholeNumbers: 0 - m_Value: -20 + m_Value: 0 m_OnValueChanged: m_PersistentCalls: m_Calls: diff --git a/Assets/Scripts/DataUtils/FileDataHandler.cs b/Assets/Scripts/DataUtils/FileDataHandler.cs index db109ca..0a67ff0 100644 --- a/Assets/Scripts/DataUtils/FileDataHandler.cs +++ b/Assets/Scripts/DataUtils/FileDataHandler.cs @@ -21,8 +21,6 @@ public class FileDataHandler GameData loadedData = null; - Debug.Log(fullPath); - if (File.Exists(fullPath)) { try @@ -40,9 +38,9 @@ public class FileDataHandler // deserialize the data from JSON to C# object loadedData = JsonUtility.FromJson<GameData>(dataToLoad); } - catch (Exception e) + catch (Exception) { - Debug.LogError("Error occured while trying to load data to file : " + fullPath + "\n" + e); + // Do nothing } } @@ -56,11 +54,6 @@ public class FileDataHandler if (File.Exists(fullPath)) { File.Delete(fullPath); - Debug.Log("File deleted successfully."); - } - else - { - Debug.LogWarning("File not found."); } } @@ -81,7 +74,6 @@ public class FileDataHandler if (!File.Exists(fullPath)) { - Debug.LogWarning("Skipping directory when loading all profiles because the data doesn't exist"); continue; } @@ -92,10 +84,6 @@ public class FileDataHandler { profileDictionary.Add(profileId, profileData); } - else - { - Debug.LogWarning("Something went wrong when loading the data."); - } } @@ -122,9 +110,9 @@ public class FileDataHandler } } } - catch (Exception e) + catch (Exception) { - Debug.LogError("Error occured while trying to save data to file : " + fullPath + "\n" + e); + // Do nothing } } } diff --git a/Assets/Scripts/MainMenu/MainMenu.cs b/Assets/Scripts/MainMenu/MainMenu.cs index b13aedc..7fd548f 100644 --- a/Assets/Scripts/MainMenu/MainMenu.cs +++ b/Assets/Scripts/MainMenu/MainMenu.cs @@ -49,7 +49,6 @@ public class MainMenu : MonoBehaviour public void OnLoadGameClicked() { - Debug.Log("OnLoadGame clicked"); DataPersistenceManager.instance.LoadGameClicked(); saveSlotsMenu.ActivateMenu(true); this.DeactivateMenu(); diff --git a/Assets/Scripts/MainMenu/SaveMenuSafeHouse.cs b/Assets/Scripts/MainMenu/SaveMenuSafeHouse.cs index 16de0c3..2cae9af 100644 --- a/Assets/Scripts/MainMenu/SaveMenuSafeHouse.cs +++ b/Assets/Scripts/MainMenu/SaveMenuSafeHouse.cs @@ -47,8 +47,6 @@ namespace Nightmare public void OnSaveSlotClicked() { - Debug.Log("SaveFromSafeHouse called"); - DataPersistenceManager.instance.ChangeSelectedProfileSafehouse(this.saveSlotNow.GetProfileId()); DataPersistenceManager.instance.SafeFromSafehouse(); diff --git a/Assets/Scripts/MainMenu/SaveSlotsMenu.cs b/Assets/Scripts/MainMenu/SaveSlotsMenu.cs index ae3e41f..ee10bc9 100644 --- a/Assets/Scripts/MainMenu/SaveSlotsMenu.cs +++ b/Assets/Scripts/MainMenu/SaveSlotsMenu.cs @@ -59,7 +59,6 @@ namespace Nightmare public void OnSaveSlotClicked() { - Debug.Log("OnSaveSlotClicked called"); DisableMenuButtons(); DataPersistenceManager.instance.ChangeSelectedProfile(this.saveSlotNow.GetProfileId()); @@ -79,8 +78,6 @@ namespace Nightmare Transform noDataContentTransform = this.saveSlotNow.transform.Find("NoDataContent"); this.isNewGame = DataPersistenceManager.instance.getNewGame(); - - Debug.Log(this.isNewGame); if (noDataContentTransform.gameObject.activeSelf || !this.isNewGame) { diff --git a/Assets/Scripts/Managers/DataPersistenceManager.cs b/Assets/Scripts/Managers/DataPersistenceManager.cs index aab4e85..59cd0ed 100644 --- a/Assets/Scripts/Managers/DataPersistenceManager.cs +++ b/Assets/Scripts/Managers/DataPersistenceManager.cs @@ -25,7 +25,6 @@ public class DataPersistenceManager : MonoBehaviour { if (instance != null) { - Debug.LogError("Found more than one DataPersistence Manager in the scene. Destroying the newest one."); Destroy(this.gameObject); return; } @@ -60,7 +59,6 @@ public class DataPersistenceManager : MonoBehaviour public void FileMechanism() { - Debug.Log("File Mechanism Called"); if (!hasSaved && !loadGame) { this.dataHandler.Delete(this.selectedProfile); @@ -68,7 +66,6 @@ public class DataPersistenceManager : MonoBehaviour } else if (loadGame) { - Debug.Log(hasSaved); if (!hasSaved) { this.dataHandler.Save(this.loadedGameData, this.selectedProfile); @@ -108,7 +105,6 @@ public class DataPersistenceManager : MonoBehaviour public void OnSceneUnloaded(Scene scene) { - Debug.Log("OnSceneUnloaded called"); if (scene.name.Contains("03") || scene.name.Contains("04") || scene.name.Contains("05") || scene.name.Contains("06")) { SaveGame(); @@ -153,13 +149,11 @@ public class DataPersistenceManager : MonoBehaviour { this.gameData = dataHandler.Load(this.selectedProfile); this.loadedGameData = this.gameData; - Debug.Log(this.selectedProfile); } // if no data can be loaded, dont continue if (this.gameData == null) { - Debug.Log("No data was found. A New Game needs to be started before data can be loaded."); return; } // TODO - push loaded data to all other scripts that need it @@ -168,8 +162,6 @@ public class DataPersistenceManager : MonoBehaviour { dataPersistenceList[i].LoadData(gameData); } - - Debug.Log("Load Game called"); } public void SaveGame() @@ -182,8 +174,6 @@ public class DataPersistenceManager : MonoBehaviour this.gameData.timestamp = DateTime.Now.ToString(); - Debug.Log("SaveHouse bool: " + this.saveSafeHouse); - // TODO - save data to a file if (saveSafeHouse) { @@ -191,8 +181,6 @@ public class DataPersistenceManager : MonoBehaviour saveSafeHouse = false; hasSaved = true; } - - Debug.Log("Save Game called"); } public bool HasGameData() diff --git a/Assets/Scripts/Managers/LevelManager.cs b/Assets/Scripts/Managers/LevelManager.cs index ac3c063..d778205 100644 --- a/Assets/Scripts/Managers/LevelManager.cs +++ b/Assets/Scripts/Managers/LevelManager.cs @@ -53,7 +53,6 @@ namespace Nightmare { if (Instance != null) { - Debug.LogError("Found more than one LevelManager in the scene. Destroying the newest one."); Destroy(this.gameObject); return; } @@ -68,7 +67,6 @@ namespace Nightmare this.currentQuest = data.currentQuest; this.isShopKeeper = data.isShopKeeper; this.safe = false; - Debug.Log("Load data scene and quest " + this.currentIndex + " " + this.currentQuest); } public void SaveData(ref GameData data) @@ -76,7 +74,6 @@ namespace Nightmare data.currentScene = this.currentIndex; data.currentQuest = this.currentQuest; data.isShopKeeper = this.isShopKeeper; - Debug.Log("Save data scene and quest " + this.currentIndex + " " + this.currentQuest); } private void Update() @@ -473,7 +470,6 @@ namespace Nightmare public void LoadScene() { - Debug.Log("CURRENT INDEX "+ currentIndex); if (levels[currentIndex].StartsWith("Cutscene")) { bool skip = true; diff --git a/Assets/Scripts/Managers/StatsManager.cs b/Assets/Scripts/Managers/StatsManager.cs index 5042851..f4689be 100644 --- a/Assets/Scripts/Managers/StatsManager.cs +++ b/Assets/Scripts/Managers/StatsManager.cs @@ -173,7 +173,6 @@ public class StatsManager : MonoBehaviour public void addGamesCompleted() { - Debug.Log("masuk add completed"); gamesCompleted += 1; } diff --git a/Assets/Scripts/Pet/BuffMovement.cs b/Assets/Scripts/Pet/BuffMovement.cs index c135293..6eaf957 100644 --- a/Assets/Scripts/Pet/BuffMovement.cs +++ b/Assets/Scripts/Pet/BuffMovement.cs @@ -21,10 +21,6 @@ public class BuffMovement : MonoBehaviour { agent.SetDestination(hit.position); } - else - { - Debug.Log("No valid position found on the NavMesh near " + target); - } } void Update() @@ -33,7 +29,6 @@ public class BuffMovement : MonoBehaviour float distance = direction.magnitude; if (distance < safeDistance) { - Debug.Log("not safe"); Vector3 newPosition = transform.position + direction.normalized * safeDistance; Move(newPosition); } diff --git a/Assets/Scripts/Pet/GoodPetHealth.cs b/Assets/Scripts/Pet/GoodPetHealth.cs index 155e63b..d897251 100644 --- a/Assets/Scripts/Pet/GoodPetHealth.cs +++ b/Assets/Scripts/Pet/GoodPetHealth.cs @@ -32,7 +32,6 @@ public class PetHealth : MonoBehaviour { currentHealth -= amount; anim.SetBool("IsAttacked", true); - Debug.Log("update health pet: " + currentHealth); StartCoroutine(ResetIsAttacked()); healthSlider.value = (float)currentHealth; } diff --git a/Assets/Scripts/Player/PlayerHealth.cs b/Assets/Scripts/Player/PlayerHealth.cs index 5ef329c..361ad68 100644 --- a/Assets/Scripts/Player/PlayerHealth.cs +++ b/Assets/Scripts/Player/PlayerHealth.cs @@ -53,7 +53,6 @@ namespace Nightmare public void SaveData(ref GameData data) { data.playerHealth = this.currentHealth; - Debug.LogError(this.currentHealth); } public void ResetPlayer() diff --git a/Assets/Scripts/Weapons/SwordSwing.cs b/Assets/Scripts/Weapons/SwordSwing.cs index 0b334f7..e2fd013 100644 --- a/Assets/Scripts/Weapons/SwordSwing.cs +++ b/Assets/Scripts/Weapons/SwordSwing.cs @@ -23,7 +23,6 @@ public class SwordSwing : MonoBehaviour { // Trigger the sword swing animation sword.GetComponent<Animator>().Play("SwordSwing"); - Debug.Log("Sword is swinging..."); // Wait for 1 second (duration of the swing animation) yield return new WaitForSeconds(1.0f); -- GitLab