Code: Select all
TargetParameterCountException: Number of parameters specified does not match the expected number.
System.Reflection.RuntimeMethodInfo.ConvertValues (System.Reflection.Binder binder, System.Object[] args, System.Reflection.ParameterInfo[] pinfo, System.Globalization.CultureInfo culture, System.Reflection.BindingFlags invokeAttr) (at <47ab72e0328040438980f9c23608e1ec>:0)
System.Reflection.RuntimeMethodInfo.Invoke (System.Object obj, System.Reflection.BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) (at <47ab72e0328040438980f9c23608e1ec>:0)
System.Reflection.MethodBase.Invoke (System.Object obj, System.Object[] parameters) (at <47ab72e0328040438980f9c23608e1ec>:0)
Language.Lua.LuaMethodFunction.InvokeMethod (Language.Lua.LuaValue[] args) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Interpreter/LuaValue/LuaMethodFunction.cs:35)
Code: Select all
Dialogue System: Lua code 'return IsTimeAfter("18:02") == true' threw exception 'Number of parameters specified does not match the expected number.'
UnityEngine.Debug:LogError (object)
PixelCrushers.DialogueSystem.Lua:RunRaw (string,bool,bool) (at Assets/Plugins/Pixel Crushers/Dialogue System/Scripts/Lua/Lua Wrapper/Lua Interpreter/Lua.cs:228)
Code: Select all
// in an MB somewhere
Lua.RegisterFunction("IsTimeAfter", this, SymbolExtensions.GetMethodInfo(() => this.IsTimeAfter(String.Empty)));
// In another file somewhere
public static bool IsTimeAfter(this IHasGameState hasState, string time)
{
var proposedTime = time.GetProposedTime();
var effectiveTime = hasState.GameState.GetEffectiveTime();
return effectiveTime > proposedTime;
}
Hopefully I am being an idiot or there is some simple fix but struggling to debug whats going on as its all down to reflection calls.