public void ChangeKeyVal(string key, object val) { SheetKeyValue kv = GetKeyValue(key); if (kv != null) { kv.value = val; } }
public T GetMetaValue <T>(string key) { SheetKeyValue kv = GetKeyValue(key); if (kv == null) { // UnityEngine.Debug.LogWarning("key value is null!"); return(default(T)); } return((T)kv.value); }
public void SetMetaValue(string key, object value) { SheetKeyValue kv = GetKeyValue(key); if (kv == null) { AddKeyValue(new SheetKeyValue(key, value)); } else { kv.value = value; } }
public void AddKeyValue(SheetKeyValue kv) { if (HasKey(kv.key)) { UnityEngine.Debug.LogError("Can't overrite key values!"); UnityEngine.Debug.LogError("Dump: " + GetDumpKeyVals()); return; } this.keyvals.Add(kv); UnityEngine.Debug.Log("kv size: " + kv.key); UnityEngine.Debug.Log(keyvals.Count); UnityEngine.Debug.Log(HasKey(kv.key)); if (!HasKey(kv.key)) { UnityEngine.Debug.LogError("Just added Kvalues not there!!"); return; } }