diff --git a/Assets/AchievementSystem/Scripts/AchievementManager.cs b/Assets/AchievementSystem/Scripts/AchievementManager.cs index 9c5f5f7f..71ea3734 100644 --- a/Assets/AchievementSystem/Scripts/AchievementManager.cs +++ b/Assets/AchievementSystem/Scripts/AchievementManager.cs @@ -7,9 +7,6 @@ using System.Collections; using TMPro; using DG.Tweening; -/// -/// Controls interactions with the Achievement System -/// [System.Serializable] public class AchievementManager : MonoBehaviour { @@ -72,27 +69,15 @@ public class AchievementManager : MonoBehaviour } } # region Miscellaneous - /// - /// Does an achievement exist in the list - /// - /// The Key of the achievement to test - /// true : if exists. false : does not exist + public bool AchievementExists(string Key) { return AchievementExists(AchievementList.FindIndex(x => x.Key.Equals(Key))); } - /// - /// Does an achievement exist in the list - /// - /// The index of the achievement to test - /// true : if exists. false : does not exist public bool AchievementExists(int Index) { return Index <= AchievementList.Count && Index >= 0; } - /// - /// Returns the total number of achievements which have been unlocked. - /// public int GetAchievedCount() { int Count = (from AchievementState i in States @@ -100,9 +85,6 @@ public class AchievementManager : MonoBehaviour select i).Count(); return Count; } - /// - /// Returns the current percentage of unlocked achievements. - /// public float GetAchievedPercentage() { if (States.Count == 0) @@ -114,10 +96,6 @@ public class AchievementManager : MonoBehaviour #endregion #region Unlock and Progress - /// - /// Fully unlocks a progression or goal achievement. - /// - /// The Key of the achievement to be unlocked public void Unlock(string Key) { Unlock(FindAchievementIndex(Key)); @@ -142,8 +120,6 @@ public class AchievementManager : MonoBehaviour HomeScene homeScene = FindAnyObjectByType(); coinTxt = homeScene.coinLbl; coinTxt.transform.DOShakePosition(1f); - //coinTxt.transform.DOShakePosition(0.5f); - // coinTxt.GetComponent().Play("textShake"); while (ct < tot) { ct += Time.deltaTime; @@ -152,13 +128,7 @@ public class AchievementManager : MonoBehaviour coinTxt.text = ((int)(val)).ToString(); yield return null; } - //coinTxt.GetComponent().Stop(); - } - /// - /// Fully unlocks a progression or goal achievement. - /// - /// The index of the achievement to be unlocked public void Unlock(int Index) { if (!States[Index].Achieved) @@ -179,42 +149,32 @@ public class AchievementManager : MonoBehaviour #endregion achievementInfromation.ProgressGoal += 5; - // Check if the new progress goal has reached or exceeded 50 if (AchievementList[Index].ProgressGoal >= 50) { - // Mark achievement as completed States[Index].Achieved = true; // Mark as achieved States[Index].Progress = AchievementList[Index].ProgressGoal; // Set progress to goal } - AutoSaveStates(); // Save states automatically if enabled + AutoSaveStates(); - // Check for final achievement if (UseFinalAchievement) { int Find = States.FindIndex(x => !x.Achieved); bool CompletedAll = (Find == -1 || AchievementList[Find].Key.Equals(FinalAchievementKey)); if (CompletedAll) { - //ButtonSetterForUnlockedAcheivement(Index); Unlock(FinalAchievementKey); // Unlock the final achievement if all others are completed } } } } - /// - /// Set the progress of an achievement to a specific value. - /// /// The Key of the achievement /// Set progress to this value public void SetAchievementProgress(string Key, float Progress) { SetAchievementProgress(FindAchievementIndex(Key), Progress); } - /// - /// Set the progress of an achievement to a specific value. - /// /// The index of the achievement /// Set progress to this value public void SetAchievementProgress(int Index, float Progress) @@ -233,18 +193,12 @@ public class AchievementManager : MonoBehaviour } } } - /// - /// Adds the input amount of progress to an achievement. Clamps achievement progress to its max value. - /// /// The Key of the achievement /// Add this number to progress public void AddAchievementProgress(string Key, float Progress) { AddAchievementProgress(FindAchievementIndex(Key), Progress); } - /// - /// Adds the input amount of progress to an achievement. Clamps achievement progress to its max value. - /// /// The index of the achievement /// Add this number to progress public void AddAchievementProgress(int Index, float Progress) @@ -317,17 +271,11 @@ public class AchievementManager : MonoBehaviour } #endregion - /// - /// Find the index of an achievement with a cetain key - /// /// Key of achievevment private int FindAchievementIndex(string Key) { return AchievementList.FindIndex(x => x.Key.Equals(Key)); } - /// - /// Test if AutoSave is valid. If true, save list - /// private void AutoSaveStates() { if (AutoSave) @@ -335,9 +283,6 @@ public class AchievementManager : MonoBehaviour SaveAchievementState(); } } - /// - /// Display achievements progress to screen - /// /// Index of achievement to display private void DisplayUnlock(int Index) { diff --git a/Assets/AchievementSystem/Scripts/AchievenmentListIngame.cs b/Assets/AchievementSystem/Scripts/AchievenmentListIngame.cs index 48c04a2d..5dc804d8 100644 --- a/Assets/AchievementSystem/Scripts/AchievenmentListIngame.cs +++ b/Assets/AchievementSystem/Scripts/AchievenmentListIngame.cs @@ -4,9 +4,6 @@ using UnityEngine.UI; using System.Collections.Generic; using System; -/// -/// Add list of achievements to screen -/// public class AchievenmentListIngame : MonoBehaviour { public GameObject scrollContent; @@ -19,11 +16,7 @@ public class AchievenmentListIngame : MonoBehaviour private bool MenuOpen = false; [Tooltip("Key used to open UI menu. Set to \"None\" to prevent menu from opening with any key press")] - // public KeyCode OpenMenuKey; //Key to open in-game menu - - /// - /// Adds all achievements to the UI based on a filter - /// + /// Filter to use (All, Achieved or Unachieved) private void AddAchievements(string Filter) { @@ -57,17 +50,11 @@ public class AchievenmentListIngame : MonoBehaviour UIAchievement.transform.SetParent(scrollContent.transform); UIAchievement.GetComponent().localScale = Vector3.one; } - /// - /// Filter out a set of locked or unlocked achievements - /// public void ChangeFilter() { AddAchievements(Filter.options[Filter.value].text); } - /// - /// Closes the UI window. - /// void Start() { AddAchievements("All"); @@ -85,9 +72,6 @@ public class AchievenmentListIngame : MonoBehaviour MenuOpen = false; Menu.Close(); } - /// - /// Opens the UI window. - /// public void OpenWindow() { MenuOpen = true; @@ -114,9 +98,6 @@ public class AchievenmentListIngame : MonoBehaviour } } } - /// - /// Toggles the state of the UI window open or closed - /// public void ToggleWindow() { if (MenuOpen) @@ -128,12 +109,4 @@ public class AchievenmentListIngame : MonoBehaviour OpenWindow(); } } - - // private void Update() - // { - // if(Input.GetKeyDown(OpenMenuKey)) - // { - // ToggleWindow(); - // } - // } } \ No newline at end of file diff --git a/Assets/AchievementSystem/Scripts/UIAchievement.cs b/Assets/AchievementSystem/Scripts/UIAchievement.cs index 4b4008c5..97741201 100644 --- a/Assets/AchievementSystem/Scripts/UIAchievement.cs +++ b/Assets/AchievementSystem/Scripts/UIAchievement.cs @@ -3,10 +3,6 @@ using System.Collections.Generic; using TMPro; using UnityEngine; using UnityEngine.UI; - -/// -/// Defines the logic behind a single achievement on the UI -/// public class UIAchievement : MonoBehaviour { public TMP_Text Title, Description, Percent; @@ -17,9 +13,6 @@ public class UIAchievement : MonoBehaviour public GameObject CompleteToClaimButton; public Button ClaimButton; - /// - /// Destroy object after a certain amount of time - /// public void StartDeathTimer () { StartCoroutine(Wait()); @@ -37,11 +30,6 @@ public class UIAchievement : MonoBehaviour Information.TotalCoinReward = TotalReward; SafePlayerPrefs.SetInt("TotalRewards"+index, TotalReward); } - - /// - /// Add information about an Achievement to the UI elements - /// - public void Set (AchievementInfromation Information, AchievementState State) { if(Information.Spoiler && !State.Achieved) diff --git a/ProjectSettings/ProjectSettings.asset b/ProjectSettings/ProjectSettings.asset index 86332202..3f908e64 100644 --- a/ProjectSettings/ProjectSettings.asset +++ b/ProjectSettings/ProjectSettings.asset @@ -140,7 +140,7 @@ PlayerSettings: loadStoreDebugModeEnabled: 0 visionOSBundleVersion: 1.0 tvOSBundleVersion: 1.0 - bundleVersion: 2.4 + bundleVersion: 2.5 preloadedAssets: [] metroInputSource: 0 wsaTransparentSwapchain: 0 @@ -170,7 +170,7 @@ PlayerSettings: iPhone: 0 tvOS: 0 overrideDefaultApplicationIdentifier: 1 - AndroidBundleVersionCode: 14 + AndroidBundleVersionCode: 15 AndroidMinSdkVersion: 22 AndroidTargetSdkVersion: 34 AndroidPreferredInstallLocation: 1