You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
70 lines
2.6 KiB
C#
70 lines
2.6 KiB
C#
//Shady
|
|
using UnityEngine;
|
|
using Sirenix.OdinInspector;
|
|
using Shady.Core.Singletons;
|
|
|
|
public sealed class GameData : SingletonScriptableObject<GameData>
|
|
{
|
|
//===================================================
|
|
// FIELDS
|
|
//===================================================
|
|
[Title("GAME DATA", "SCRIPTABLE SINGLETON", titleAlignment: TitleAlignments.Centered, true, true)]
|
|
[Switch]
|
|
[SerializeField] bool _initializeLogs = true;
|
|
[Switch]
|
|
[SerializeField] bool _enableLogs = true;
|
|
[Switch]
|
|
[SerializeField] bool _debugConsole = true;
|
|
[Switch]
|
|
[SerializeField] bool _skipSplash = true;
|
|
[Space]
|
|
[Title("API")]
|
|
[SerializeField] string _baseAPI = "http://localhost:8080/";
|
|
[Space]
|
|
[SerializeField] string _splashDataAPI = "data/splashData.json";
|
|
[SerializeField] string _splashImageAPI = "data/image/";
|
|
[Space]
|
|
[SerializeField] string _getUserAPI = "user/getUser/";
|
|
[SerializeField] string _createUserAPI = "user/createUser/";
|
|
[SerializeField] string _updateUserAPI = "user/updateUser/";
|
|
[Space]
|
|
[SerializeField] MovementSettings _movementSettings = new();
|
|
|
|
//===================================================
|
|
// PROPERTIES
|
|
//===================================================
|
|
public bool InitLogs => _initializeLogs;
|
|
public bool EnableLogs => _enableLogs;
|
|
public bool DebugConsole => _debugConsole;
|
|
public bool SkipSplash => _skipSplash;
|
|
public string BaseAPI => _baseAPI;
|
|
public string SplashDataAPI => _baseAPI + _splashDataAPI;
|
|
public string SplashImageAPI => _baseAPI + _splashImageAPI;
|
|
public string GetUserAPI => _baseAPI + _getUserAPI;
|
|
public string CreateUserAPI => _baseAPI + _createUserAPI;
|
|
public string UpdateUserAPI => _baseAPI + _updateUserAPI;
|
|
public MovementSettings MovementSettings => _movementSettings;
|
|
|
|
[Title("Save Data")]
|
|
[InlineProperty]
|
|
[ShowInInspector]
|
|
private SaveData _saveData
|
|
{
|
|
get
|
|
{
|
|
if(Application.isPlaying)
|
|
return SaveData.Instance;
|
|
else
|
|
return null;
|
|
}//get end
|
|
}//SaveData end
|
|
|
|
//===================================================
|
|
// METHODS
|
|
//===================================================
|
|
#if UNITY_EDITOR
|
|
[UnityEditor.MenuItem("Shady/Game Data %#g", false, 1)]
|
|
public static void CreateObject() => SelectHolder();
|
|
#endif
|
|
|
|
}//class end |