using Crosstales.FB.Util; namespace Crosstales.FB.Util { /// Configuration for the asset. public static class Config { #region Changable variables /// Path to the asset inside the Unity project. public static string ASSET_PATH = "/Plugins/crosstales/FileBrowser/"; /// Enable or disable debug logging for the asset. public static bool DEBUG = Constants.DEFAULT_DEBUG || Constants.DEV_DEBUG; /// Enable or disable native file browser inside the Unity Editor. public static bool NATIVE_WINDOWS = Constants.DEFAULT_NATIVE_WINDOWS; /// Is the configuration loaded? public static bool isLoaded; #endregion #if UNITY_EDITOR #region Public static methods /// Resets all changeable variables to their default value. public static void Reset() { if (!Constants.DEV_DEBUG) DEBUG = Constants.DEFAULT_DEBUG; NATIVE_WINDOWS = Constants.DEFAULT_NATIVE_WINDOWS; } /// Loads the all changeable variables. public static void Load() { if (Crosstales.Common.Util.CTPlayerPrefs.HasKey(Constants.KEY_ASSET_PATH)) { ASSET_PATH = Crosstales.Common.Util.CTPlayerPrefs.GetString(Constants.KEY_ASSET_PATH); } if (!Constants.DEV_DEBUG) { if (Crosstales.Common.Util.CTPlayerPrefs.HasKey(Constants.KEY_DEBUG)) DEBUG = Crosstales.Common.Util.CTPlayerPrefs.GetBool(Constants.KEY_DEBUG); } else { DEBUG = Constants.DEV_DEBUG; } if (Crosstales.Common.Util.CTPlayerPrefs.HasKey(Constants.KEY_NATIVE_WINDOWS)) NATIVE_WINDOWS = Crosstales.Common.Util.CTPlayerPrefs.GetBool(Constants.KEY_NATIVE_WINDOWS); isLoaded = true; } /// Saves the all changeable variables. public static void Save() { if (!Constants.DEV_DEBUG) Crosstales.Common.Util.CTPlayerPrefs.SetBool(Constants.KEY_DEBUG, DEBUG); Crosstales.Common.Util.CTPlayerPrefs.SetBool(Constants.KEY_NATIVE_WINDOWS, NATIVE_WINDOWS); Crosstales.Common.Util.CTPlayerPrefs.Save(); } #endregion #endif } } // © 2017-2023 crosstales LLC (https://www.crosstales.com)