Open perandersson opened 11 years ago
Each thread should have it's own lua_State. After the SceneGroup is loaded, return it and re-register it inside the main lua state. As long as the reference ID and internal state of the Scriptable object is updated - this should not be a problem
Problems might occur for script generated classes with lua overloaded functions.
Possible solution is to use non-lua dependent script_ref identifier. Instead use a lookup table for objects:
local ref = Lookup(self)
Possible solution: Don't do anything. This might not be a problem since all non-scripted resources are loaded in the multithreaded resource loader.
Find a solution for loading SceneGroups in the ResourceLoader thread