Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
plasmalasgun opened this issue Aug 4, 2014 · 0 comments
Open

Comments

@plasmalasgun
Copy link

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant