コード例 #1
0
    public void UpdateVariables()
    {
        AlMightyVariablesNum.Clear();
        AlMightyVariablesStr.Clear();
        AlMightyVariablesBool.Clear();
        try {
            foreach (string key in LuaScriptBinder.GetAlMightyDictionary().Keys)
            {
                DynValue dv;
                LuaScriptBinder.GetAlMightyDictionary().TryGetValue(key, out dv);
                if (dv != null)
                {
                    switch (dv.Type)
                    {
                    case DataType.Number:  AlMightyVariablesNum.Add(key, dv.Number);   break;

                    case DataType.String:  AlMightyVariablesStr.Add(key, dv.String);   break;

                    case DataType.Boolean: AlMightyVariablesBool.Add(key, dv.Boolean); break;

                    default:               UnitaleUtil.WriteInLogAndDebugger("SaveLoad: This DynValue can't be added to the save because it is unserializable."); break;
                    }
                }
            }
        } catch { /* ignored */ }
    }