Code example: When I try to add this test function (same behavior with this and the real thing I'm trying to run):
Code: Select all
Lua.RegisterFunction("Test", this, typeof(DialogueVars).GetMethod("Test"));
public void Test()
{
Debug.Log("fired");
}
Code: Select all
if(Input.GetKeyDown(KeyCode.J))
{
DialogueManager.Bark("TestBark", this.transform);
}
Code: Select all
fired
UnityEngine.Debug:Log(Object)
DialogueVars:Test() (at Assets/Scripts/DialogueVars.cs:42)
System.Reflection.MethodBase:Invoke(Object, Object[])
Language.Lua.LuaMethodFunction:InvokeMethod(LuaValue[])
Language.Lua.FunctionCall:Evaluate(LuaValue, LuaTable)
Language.Lua.PrimaryExpr:Evaluate(LuaTable)
Language.Lua.ExprStmt:Execute(LuaTable, Boolean&)
Language.Lua.Chunk:Execute(Boolean&)
Language.Lua.Chunk:Execute()
Language.Lua.LuaInterpreter:Interpreter(String, LuaTable)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.ConversationModel:GetState(DialogueEntry, Boolean, Boolean, Boolean)
PixelCrushers.DialogueSystem.<Bark>c__Iterator5:MoveNext()
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
PixelCrushers.DialogueSystem.DialogueSystemController:Bark(String, Transform, Transform, BarkHistory)
PixelCrushers.DialogueSystem.DialogueSystemController:Bark(String, Transform)
PixelCrushers.DialogueSystem.DialogueManager:Bark(String, Transform)
NPC:Update() (at Assets/Scripts/AI/NPC.cs:89)
Code: Select all
fired
UnityEngine.Debug:Log(Object)
DialogueVars:Test() (at Assets/Scripts/DialogueVars.cs:42)
System.Reflection.MethodBase:Invoke(Object, Object[])
Language.Lua.LuaMethodFunction:InvokeMethod(LuaValue[])
Language.Lua.FunctionCall:Evaluate(LuaValue, LuaTable)
Language.Lua.PrimaryExpr:Evaluate(LuaTable)
Language.Lua.ExprStmt:Execute(LuaTable, Boolean&)
Language.Lua.Chunk:Execute(Boolean&)
Language.Lua.Chunk:Execute()
Language.Lua.LuaInterpreter:Interpreter(String, LuaTable)
PixelCrushers.DialogueSystem.Lua:RunRaw(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.Lua:Run(String, Boolean, Boolean)
PixelCrushers.DialogueSystem.<Bark>c__Iterator5:MoveNext()
UnityEngine.MonoBehaviour:StartCoroutine(IEnumerator)
PixelCrushers.DialogueSystem.DialogueSystemController:Bark(String, Transform, Transform, BarkHistory)
PixelCrushers.DialogueSystem.DialogueSystemController:Bark(String, Transform)
PixelCrushers.DialogueSystem.DialogueManager:Bark(String, Transform)
NPC:Update() (at Assets/Scripts/AI/NPC.cs:89)