public static void AddValue(SamAchievements.AchievementNames name, int v) { if(Achievements.GetAchievement(name).AddValue(v)) //returns true if achievements is unlocked { Debug.Log("Unlocked Achievement: " + name.ToString()); } }
public static void Unlock(SamAchievements.AchievementNames name) { if(Achievements.GetAchievement(name).Unlock()) //returns true if achievements is unlocked { Debug.Log("Unlocked Achievement: " + name.ToString()); SaveAchievements(); } }
public static void LoadAchievements() { if (!File.Exists(Application.persistentDataPath + "/samach.ach")) { m_achievements = new SamAchievements(); return; } BinaryFormatter bf = new BinaryFormatter(); FileStream fs = File.Open(Application.persistentDataPath + "/samach.ach", FileMode.Open); m_achievements = (SamAchievements)bf.Deserialize(fs); fs.Close(); }