UniLua
UniLua copied to clipboard
Examples of passing unity objects from c# to lua and lua to c#
Can you provide examples:
- how a unity object created in lua can be passed to c#
//c# public static int testfunc( ILuaState lua ) { GameObject pGameObject = (GameObject)lua.ToUserData( 1 ); Debug.Log("pGameObject.name "+pGameObject.name ); {
-- Lua local goPlaceholder = GameObject._New("testObject") testfunc( goPlaceholder )
ERROR
NullReferenceException: Object reference not set to an instance of an object
- how a unity object created in c# can be passed to lua
Thanks in advance!