Пример #1
0
        public void ChangeKeyVal(string key, object val)
        {
            SheetKeyValue kv = GetKeyValue(key);

            if (kv != null)
            {
                kv.value = val;
            }
        }
Пример #2
0
        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);
        }
Пример #3
0
        public void SetMetaValue(string key, object value)
        {
            SheetKeyValue kv = GetKeyValue(key);

            if (kv == null)
            {
                AddKeyValue(new SheetKeyValue(key, value));
            }
            else
            {
                kv.value = value;
            }
        }
Пример #4
0
        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;
            }
        }