using NEG.Utils.Achievments.AchievmentTypes; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; namespace NEG.Utils.Achievments { public static class Achievments { public static AchievmentManager Instance { get { if (instance == null) { instance = AchievmentManager.Builder.FromDefaultConfig() .WithLabeledBackend(BackendLabel) .Build(); } return instance; } } internal static string BackendLabel { get => backendLabel; set { if (backendLabel != null) { throw new ApplicationException("Multiple AchievmentBackends enabled, this is not allowed"); } backendLabel = value; } } private static string backendLabel; private static AchievmentManager instance; #region Achievment Manipulation (Sets, Gets) /// /// Returns if an achivment at a given id is completed /// /// /// /// /// throws an if there is no achievment under id public static bool IsCompleted(string id) { return instance.IsCompleted(id); } #region Toggle /// /// Sets a as completed.
///
/// /// /// throws an if there is no achievment under id or an if achievment under id is of a different type public static bool SetToggleAchivment(string id) { return instance.SetToggleAchivment(id); } /// /// Gets a completion state from a .
///
/// /// /// throws an if there is no achievment under id or an if achievment under id is of a different type public static bool GetToggleState(string id) { return instance.GetToggleState(id); } #endregion #region Int /// /// Sets progress of a given to
///
/// /// /// throws an if there is no achievment under id or an if achievment under id is of a different type public static bool SetIntProgress(string id, int progress) { return instance.SetIntProgress(id, progress); } /// /// Changes progress of a given by
///
/// \ /// /// throws an if there is no achievment under id or an if achievment under id is of a different type public static bool ChangeIntProgress(string id, int delta) { return instance.ChangeIntProgress(id, delta); } /// /// Gets current progress from a .
///
/// /// /// throws an if there is no achievment under id or an if achievment under id is of a different type public static int GetIntProgress(string id) { return instance.GetIntProgress(id); } #endregion #region Float /// /// Sets progress of a given to
///
/// /// /// throws an if there is no achievment under id or an if achievment under id is of a different type public static bool SetFloatProgress(string id, float progress) { return instance.SetFloatProgress(id, progress); } /// /// Changes progress of a given by
///
/// /// /// throws an if there is no achievment under id or an if achievment under id is of a different type public static bool ChangeFloatProgress(string id, float delta) { return instance.ChangeFloatProgress(id, delta); } /// /// Gets current progress from a .
///
/// /// /// throws an if there is no achievment under id or an if achievment under id is of a different type public static float GetFloatProgress(string id) { return instance.GetFloatProgress(id); } #endregion #endregion } }