public void Start() { //Init LuaBinding class that demonstrates communication LuaBinding binding = new LuaBinding(); //Init instance of Lua virtual machine (Note: Can only init ONCE) luaVirtualMachine = new Lua(); //Tell Lua about the LuaBinding object to allow Lua to call C# functions luaVirtualMachine["luabinding"] = binding; //test luabinding test LuaBindingTest bindingTest = LuaBindingTest.SharedInstance(); bindingTest.name = "name1"; luaVirtualMachine["LuaBindingTest"] = bindingTest; //luaVirtualMachine[""] = ; //Debug.LogError("LuaManager: " + Application.persistentDataPath); //Run the code contained within the file #if UNITY_ANDROID luaVirtualMachine.DoFile("/sdcard/Download/"+LuaFileToLoad); #else luaVirtualMachine.DoFile(Application.streamingAssetsPath+"/"+LuaFileToLoad); #endif //Trigger binding in c# to call the bound Lua function binding.MessageToLua(); TestStaticFunction(); }
public void Start() { //Init LuaBinding class that demonstrates communication LuaBinding binding = new LuaBinding(); //Init instance of Lua virtual machine (Note: Can only init ONCE) luaVirtualMachine = new Lua(); //Tell Lua about the LuaBinding object to allow Lua to call C# functions luaVirtualMachine["luabinding"] = binding; //test luabinding test LuaBindingTest bindingTest = LuaBindingTest.SharedInstance(); bindingTest.name = "name1"; luaVirtualMachine["LuaBindingTest"] = bindingTest; //luaVirtualMachine[""] = ; //Debug.LogError("LuaManager: " + Application.persistentDataPath); //Run the code contained within the file #if UNITY_ANDROID luaVirtualMachine.DoFile("/sdcard/Download/" + LuaFileToLoad); #else luaVirtualMachine.DoFile(Application.streamingAssetsPath + "/" + LuaFileToLoad); #endif //Trigger binding in c# to call the bound Lua function binding.MessageToLua(); TestStaticFunction(); }
public void Start() { //Init LuaBinding class that demonstrates communication LuaBinding binding = new LuaBinding(); //Init instance of Lua virtual machine (Note: Can only init ONCE) luaVirtualMachine = new Lua(); //Tell Lua about the LuaBinding object to allow Lua to call C# functions luaVirtualMachine["luabinding"] = binding; //Run the code contained within the file luaVirtualMachine.DoFile(Application.streamingAssetsPath + "/" + LuaFileToLoad); //Trigger binding in c# to call the bound Lua function binding.MessageToLua(); }
public void Start() { //Init LuaBinding class that demonstrates communication LuaBinding binding = new LuaBinding(); //Init instance of Lua virtual machine (Note: Can only init ONCE) luaVirtualMachine = new Lua(); //Tell Lua about the LuaBinding object to allow Lua to call C# functions luaVirtualMachine["luabinding"] = binding; //Run the code contained within the file luaVirtualMachine.DoFile(Application.streamingAssetsPath+"/"+LuaFileToLoad); //Trigger binding in c# to call the bound Lua function binding.MessageToLua(); }
void InitLua() { //Init LuaBinding class that demonstrates communication LuaBinding binding = new LuaBinding(); DebugBinding debug = new DebugBinding(); //Init instance of Lua virtual machine (Note: Can only init ONCE) luaVM = new Lua(); luaVM.DoFile(Application.streamingAssetsPath + Path.DirectorySeparatorChar + "vm.lua"); //Tell Lua about the LuaBinding object to allow Lua to call C# functions luaVM["luabinding"] = binding; luaVM["debug"] = debug; //Run the code contained within the file luaVM.DoFile(Application.streamingAssetsPath + "/" + "luademo.lua"); //Trigger binding in c# to call the bound Lua function binding.MessageToLua(); }