UniLua icon indicating copy to clipboard operation
UniLua copied to clipboard

Examples of passing unity objects from c# to lua and lua to c#

Open plasmalasgun opened this issue 11 years ago • 0 comments

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!

plasmalasgun avatar Aug 04 '14 05:08 plasmalasgun