浏览代码

Updated GameSaveManager API to restrict types

/main
Thomas ICHÉ 5 年前
当前提交
8b20d584
共有 1 个文件被更改,包括 17 次插入13 次删除
  1. 30
      Runtime/Managers/Implementations/GameSaveManager.cs

30
Runtime/Managers/Implementations/GameSaveManager.cs


private void OnEnable()
{
// Load System Save
//TestFunc();
}
void TestFunc()
{
SetValue("Toto", Location.System, 1.0f);
SetValue("Tata", Location.System, 10);
SetValue("Titi", Location.System, "1.0");
SetValue("Tutu", Location.System, false);
SaveSystemSave();
}
#region SAVE/LOAD

#region VALUES
public bool HasBool(string name, Location location) { return HasValue<bool>(name, location); }
public bool HasInt(string name, Location location) { return HasValue<int>(name, location); }
public bool HasFloat(string name, Location location) { return HasValue<float>(name, location); }
public bool HasSting(string name, Location location) { return HasValue<string>(name, location); }
public bool GetBool(string name, Location location) { return GetValue<bool>(name, location); }
public int GetInt(string name, Location location) { return GetValue<int>(name, location); }
public float GetFloat(string name, Location location) { return GetValue<float>(name, location); }
public string GetString(string name, Location location) { return GetValue<string>(name, location); }
public void SetBool(string name, Location location, bool value) { SetValue(name, location, value); }
public void SetInt(string name, Location location, int value) { SetValue(name, location, value); }
public void SetFloat(string name, Location location, float value) { SetValue(name, location, value); }
public void SetString(string name, Location location, string value) { SetValue(name, location, value); }
public enum Location
{
System = 0,

}
public bool HasValue<T>(string name, Location location)
bool HasValue<T>(string name, Location location)
public T GetValue<T>(string name, Location location)
T GetValue<T>(string name, Location location)
{
if (HasValue<T>(name, location))
{

正在加载...
取消
保存