少年修仙传客户端基础资源
client_Wu Xijin
2018-10-29 8efd04f4314e44c5b732e95163383b1911d279cb
Assets/XLua/Src/ObjectTranslator.cs
@@ -272,9 +272,9 @@
            ERROR
        }
#if UNITY_EDITOR || XLUA_GENERAL
        Type delegate_birdge_type;
#if UNITY_EDITOR || XLUA_GENERAL
        class CompareByArgRet : IEqualityComparer<MethodInfo>
        {
            public bool Equals(MethodInfo x, MethodInfo y)
@@ -296,8 +296,8 @@
        void initCSharpCallLua()
        {
            delegate_birdge_type = typeof(DelegateBridge);
#if UNITY_EDITOR || XLUA_GENERAL
            delegate_birdge_type = typeof(DelegateBridge);
            if (!DelegateBridge.Gen_Flag)
            {
                List<Type> cs_call_lua = new List<Type>();
@@ -373,7 +373,7 @@
                }
            }
            throw new InvalidCastException("This type must add to CSharpCallLua: " + delegateType);
            throw new InvalidCastException("This type must add to CSharpCallLua: " + delegateType.GetFriendlyName());
        }
        Dictionary<int, WeakReference> delegate_bridges = new Dictionary<int, WeakReference>();
        public object CreateDelegateBridge(RealStatePtr L, Type delegateType, int idx)
@@ -587,6 +587,9 @@
            LuaAPI.xlua_pushasciistring(L, "import_type");
         LuaAPI.lua_pushstdcallcfunction(L,importTypeFunction);
         LuaAPI.lua_rawset(L, -3);
            LuaAPI.xlua_pushasciistring(L, "import_generic_type");
            LuaAPI.lua_pushstdcallcfunction(L, StaticLuaCallbacks.ImportGenericType);
            LuaAPI.lua_rawset(L, -3);
            LuaAPI.xlua_pushasciistring(L, "cast");
            LuaAPI.lua_pushstdcallcfunction(L, castFunction);
            LuaAPI.lua_rawset(L, -3);
@@ -604,6 +607,9 @@
            LuaAPI.lua_rawset(L, -3);
            LuaAPI.xlua_pushasciistring(L, "tofunction");
            LuaAPI.lua_pushstdcallcfunction(L, StaticLuaCallbacks.ToFunction);
            LuaAPI.lua_rawset(L, -3);
            LuaAPI.xlua_pushasciistring(L, "get_generic_method");
            LuaAPI.lua_pushstdcallcfunction(L, StaticLuaCallbacks.GetGenericMethod);
            LuaAPI.lua_rawset(L, -3);
            LuaAPI.xlua_pushasciistring(L, "release");
            LuaAPI.lua_pushstdcallcfunction(L, StaticLuaCallbacks.ReleaseCsObject);
@@ -759,6 +765,10 @@
                    if (rawObject != null)
                    {
                        obj = rawObject.Target;
                    }
                    if (obj == null)
                    {
                        return !type.IsValueType;
                    }
                    return type.IsAssignableFrom(obj.GetType());
                }
@@ -1255,7 +1265,7 @@
            }
            else if (objects.TryGetValue(udata, out obj))
            {
#if !UNITY_5 && !XLUA_GENERAL && !UNITY_2017
#if !UNITY_5 && !XLUA_GENERAL && !UNITY_2017 && !UNITY_2017_1_OR_NEWER && !UNITY_2018
                if (obj != null && obj is UnityEngine.Object && ((obj as UnityEngine.Object) == null))
                {
                    //throw new UnityEngine.MissingReferenceException("The object of type '"+ obj.GetType().Name +"' has been destroyed but you are still trying to access it.");