Beispiel #1
0
 public override void OnEnter()
 {
     if (PlayMakerTools.IsValueAssigned(element) && PlayMakerTools.IsValueAssigned(field))
     {
         string     tableName = PlayMakerTools.LuaTableName(table);
         Lua.Result luaResult = DialogueLua.GetTableField(tableName, element.Value, field.Value);
         if (storeStringResult != null)
         {
             storeStringResult.Value = luaResult.AsString;
         }
         if (storeFloatResult != null)
         {
             storeFloatResult.Value = luaResult.AsFloat;
         }
         if (storeBoolResult != null)
         {
             storeBoolResult.Value = luaResult.AsBool;
         }
     }
     else
     {
         LogWarning(string.Format("{0}: Element and Field must be assigned first.", DialogueDebug.Prefix));
     }
     Finish();
 }
Beispiel #2
0
 private void GetAndStore()
 {
     if (PlayMakerTools.IsValueAssigned(element) && PlayMakerTools.IsValueAssigned(field))
     {
         string     tableName = PlayMakerTools.LuaTableName(table);
         Lua.Result luaResult = (getLocalizedVersion != null && getLocalizedVersion.Value == true)
             ? DialogueLua.GetLocalizedTableField(tableName, element.Value, field.Value)
             : DialogueLua.GetTableField(tableName, element.Value, field.Value);
         if (storeStringResult != null)
         {
             storeStringResult.Value = luaResult.AsString;
         }
         if (storeFloatResult != null)
         {
             storeFloatResult.Value = luaResult.AsFloat;
         }
         if (storeIntResult != null)
         {
             storeIntResult.Value = luaResult.AsInt;
         }
         if (storeBoolResult != null)
         {
             storeBoolResult.Value = luaResult.AsBool;
         }
     }
     else
     {
         LogWarning(string.Format("{0}: Element and Field must be assigned first.", DialogueDebug.Prefix));
     }
 }