Esempio n. 1
0
        public object __Gen_Delegate_Imp15(string p0, string p1, System.Type p2, out FairyGUI.DestroyMethod p3)
        {
#if THREAD_SAFE || HOTFIX_ENABLE
            lock (luaEnv.luaEnvLock)
            {
#endif
            RealStatePtr L = luaEnv.rawL;
            int errFunc    = LuaAPI.pcall_prepare(L, errorFuncRef, luaReference);
            ObjectTranslator translator = luaEnv.translator;
            LuaAPI.lua_pushstring(L, p0);
            LuaAPI.lua_pushstring(L, p1);
            translator.Push(L, p2);

            PCall(L, 3, 2, errFunc);

            translator.Get(L, errFunc + 2, out p3);

            object __gen_ret = translator.GetObject(L, errFunc + 1, typeof(object));
            LuaAPI.lua_settop(L, errFunc - 1);
            return(__gen_ret);

#if THREAD_SAFE || HOTFIX_ENABLE
        }
#endif
        }
Esempio n. 2
0
 static int SetItemAsset(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 4);
         FairyGUI.UIPackage   obj  = (FairyGUI.UIPackage)ToLua.CheckObject <FairyGUI.UIPackage>(L, 1);
         FairyGUI.PackageItem arg0 = (FairyGUI.PackageItem)ToLua.CheckObject <FairyGUI.PackageItem>(L, 2);
         object arg1 = ToLua.ToVarObject(L, 3);
         FairyGUI.DestroyMethod arg2 = (FairyGUI.DestroyMethod)ToLua.CheckObject(L, 4, typeof(FairyGUI.DestroyMethod));
         obj.SetItemAsset(arg0, arg1, arg2);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Esempio n. 3
0
    static int set_destroyMethod(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.NTexture      obj  = (FairyGUI.NTexture)o;
            FairyGUI.DestroyMethod arg0 = (FairyGUI.DestroyMethod)ToLua.CheckObject(L, 2, typeof(FairyGUI.DestroyMethod));
            obj.destroyMethod = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index destroyMethod on a nil value"));
        }
    }
Esempio n. 4
0
    static int get_destroyMethod(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            FairyGUI.NTexture      obj = (FairyGUI.NTexture)o;
            FairyGUI.DestroyMethod ret = obj.destroyMethod;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o, "attempt to index destroyMethod on a nil value"));
        }
    }
Esempio n. 5
0
    private object myFairyUILoadFunc(string name, string extension, System.Type type, out FairyGUI.DestroyMethod destroyMethod)
    {
        var inBundleName = name;

        if (name.StartsWith(AssetBundleLoader.pathPrefix))
        {
            inBundleName = name.Substring(AssetBundleLoader.pathPrefix.Length);
        }

        destroyMethod = FairyGUI.DestroyMethod.Unload;
        var assetPath = inBundleName + extension;

        // 以后可以注释掉
        // Debug.Log($"myFairyUILoadFunc, name:{name}, in-bundle name:{inBundleName}, extension:{extension}, type:{type}");

        if (inBundleName.StartsWith("lobby"))
        {
            return(lobby.loader.LoadFromBundleAsType(assetPath, type));
        }

        // 如果不属于lobby模块,则找到对应的模块然后请求该模块加载
        foreach (var m in lobby.subModules.Values)
        {
            if (inBundleName.StartsWith(m.modName))
            {
                return(m.loader.LoadFromBundleAsType(assetPath, type));
            }
        }

        return(null);
    }