/// <summary> /// When drawing the GUI, adds a "Reset Achievements" button, that does exactly what you think it does. /// </summary> public override void OnInspectorGUI() { DrawDefaultInspector(); MMAchievementList achievementList = (MMAchievementList)target; if (GUILayout.Button("Reset Achievements")) { achievementList.ResetAchievements(); } EditorUtility.SetDirty(achievementList); }
/// <summary> /// You'll need to call this method to initialize the manager /// </summary> public static void LoadAchievementList(MMAchievementList achievementList) { _achievements = new List <MMAchievement> (); if (achievementList == null) { return; } // we store the ID for save purposes _listID = achievementList.AchievementsListID; foreach (MMAchievement achievement in achievementList.Achievements) { _achievements.Add(achievement.Copy()); } }
/// <summary> /// You'll need to call this method to initialize the manager /// </summary> public static void LoadAchievementList() { _achievements = new List <MMAchievement> (); // the Achievement List scriptable object must be in a Resources folder inside your project, like so : Resources/Achievements/PUT_SCRIPTABLE_OBJECT_HERE MMAchievementList achievementList = (MMAchievementList)Resources.Load("Achievements/AchievementList"); if (achievementList == null) { return; } // we store the ID for save purposes _listID = achievementList.AchievementsListID; foreach (MMAchievement achievement in achievementList.Achievements) { _achievements.Add(achievement.Copy()); } }