Library to expose access for getting and setting the current script instance.
You can use LuaScriptInstance in your own project by adding this project as a Defold library dependency. Open your game.project file and in the dependencies field under project add:
https://github.com/DanEngelbrecht/LuaScriptInstance/archive/master.zip
Or point to the ZIP file of a specific release.
Once the dependecy is added two Lua functions are available:
LuaScriptInstance.Get()
and LuaScriptInstance.Set(instance)
Gets the current script instance. The returned value is an opaque type and you should only use it to set the current instance.
RETURN
instance
(opaque) - the current script instance
Sets the current script instance. The instance parameters must be a value returned by LuaScriptInstance.Get().
PARAMETERS
instance
(opaque) - the script instance to set