-
Notifications
You must be signed in to change notification settings - Fork 436
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
Unity crash when trying to get UnityEngine.Color.Instance #254
Comments
LuaTable.getObject(same as []) will split passed key string by '.' to path list, luatable use the path-list to find value step by step, but UnityEngine.Color don't have a key named Instance, so report a error. slua use ""UnityEngine.Color.Instance" as whole key to store instance method table. |
The thing is that it's okay if I just iterate over _G's objects via ´foreach (var kvp in _g)´, but when I iterate over all the keys via a list later, Unity crashes, and that shouldn't happen IMHO. |
I add 2 function get/set key from/to table. |
I also add rawget/set flag for get/set functions. |
The following code crashes Unity (2018.2.15) on the second line:
var _g = luaState["_G"] as SLua.LuaTable;
var color = _g["UnityEngine.Color.Instance"];
luaState is a correctly initialized Slua.LuaState.
The text was updated successfully, but these errors were encountered: