예제 #1
0
    static int _CreateAssetRequesetMsg(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 7)
            {
                ushort           arg0 = (ushort)LuaDLL.luaL_checknumber(L, 1);
                ushort           arg1 = (ushort)LuaDLL.luaL_checknumber(L, 2);
                string           arg2 = ToLua.CheckString(L, 3);
                string[]         arg3 = ToLua.CheckStringArray(L, 4);
                string[]         arg4 = ToLua.CheckStringArray(L, 5);
                bool[]           arg5 = ToLua.CheckBoolArray(L, 6);
                int[]            arg6 = ToLua.CheckNumberArray <int>(L, 7);
                AssetRequesetMsg obj  = new AssetRequesetMsg(arg0, arg1, arg2, arg3, arg4, arg5, arg6);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: AssetRequesetMsg.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
예제 #2
0
    //HunkRes = ManagerID.AssetManager+1,

    //ReleaseSingleObj , //释放单个object

    //ReleaseBundleObjes,//释放一个bundle 包里 所有的object

    //ReleaseScenceObjes,// 释放 单个场景中所有的 object

    //ReleaseSingleBundle,//释放单个 assetbundle

    //ReleaseScenceBundle,//释放 一个场景中的所有的assetbundle

    //ReleaseAll,// 释放 一个场景中所有的 bundle 和 objects

    public override void ProcessEvent(MsgBase msg)
    {
        switch (msg.msgId)
        {
        case (ushort)AssetEvent.HunkMutiRes:

        {
            AssetRequesetMsg tmpMsg = (AssetRequesetMsg)msg;



            tmpMsg.requesetInfo.Debug();

            BundleRequest tmpRequeset = MutiResManager.AddRequeset(tmpMsg);


            try
            {
                int tmpCount = tmpRequeset.bundleNode.Length;

                for (int i = 0; i < tmpCount; i++)
                {
                    BundleBackNode tmpNode = tmpRequeset.bundleNode[i];

                    string bundlFullName = ILoadManager.Instance.GetBundleRelateName(tmpNode.ScenceName, tmpNode.BundleName);

                    tmpNode.FullBundleName = bundlFullName;



                    MutiResManager.AddNodes(tmpNode);


                    RequesetBundle(tmpNode.ScenceName, tmpNode.BundleName, bundlFullName);
                }
            }
            catch (System.Exception e)
            {
                Debug.LogError("e ==" + e);
            }
        }
        break;

        case (ushort)AssetEvent.HunkScences:
        {
            RequesetScenceMsg tmpMsg = (RequesetScenceMsg)msg;


            ILoadManager.Instance.LoadAsset(tmpMsg.scenceName, tmpMsg.bundleName, tmpMsg.backDelegate);
        }
        break;



        default:
            break;
        }
    }
예제 #3
0
    private void GetResoures()
    {
        //        --- 申请多个bundle 里面多个资源

        //-- bundle 对应的名字   以下是二个bundle 包

        string[] bundle =
        {
            "Loading", "Registing"
        };



        string[][] resName = new string[2][];

        //第一bundle 包里的资源名字
        resName[0] = new string[1] {
            "Loading.prefab"
        };
        //第二bundle 包里的
        // ------- -----------------------------这里面要加后缀 .prefab   .png----------TestTwo多个情况不用加----------
        resName[1] = new string[1] {
            "Registing.prefab"
        };                                                  // button_endless



        bool[][] singles = new bool[2][];

        //第一bundle 包里的资源 是单个资源还是多个资源true 表示单个
        singles[0] = new bool[1] {
            true
        };
        //第二bundle 包里的资源 是单个资源还是多个资源true 表示单个
        singles[1] = new bool[1] {
            true
        };



        AssetRequesetMsg tmpMsg = ObjectPoolManager <AssetRequesetMsg> .Instance.GetFreeObject();

        tmpMsg.ChangeEventMsg((ushort)AssetEvent.HunkMutiRes, (ushort)TestShopEvents.GetResources, "UIScence", bundle, resName, singles);


        Debug.Log(" back Id  ==" + (ushort)TestShopEvents.GetResources);
        SendMsg(tmpMsg);



        ObjectPoolManager <AssetRequesetMsg> .Instance.ReleaseObject(tmpMsg);
    }
예제 #4
0
    //public string scenceName;
    //public string[] bundles;

    //public string[][] resNames;

    //public ushort backId;

    /// <summary>
    ///  上层消息 转化为requeset 表
    /// </summary>
    /// <param name="tmpMsg"></param>
    /// <returns></returns>
    public BundleRequest AddRequeset(AssetRequesetMsg tmpMsg)
    {
        //   BundleBackNode tmpNode = new BundleBackNode();

        BundleRequest tmpRequeset = new BundleRequest(tmpMsg.requesetInfo, monoBase, FinishRequeset);

        // Debug.Log("tmpRequeset back msgid ===="+tmpRequeset.BackId);
        requesetManager.AddRequeset(tmpRequeset);

        // ABReuqeset(tmpRequeset);


        return(tmpRequeset);
    }
예제 #5
0
    private void GetResoures()
    {
        //        --- 申请多个bundle 里面多个资源

        //-- bundle 对应的名字   以下是二个bundle 包

        string[] bundle =
        {
            "Loading", "Registing"
        };



        string[][] resName = new string[2][];

        //第一bundle 包里的资源名字
        resName[0] = new string[1] {
            "Loading.prefab"
        };
        resName[1] = new string[1] {
            "Registing.prefab"
        };

        // resName[2] = new string[1] { "Test.prefab" };


        bool[][] singles = new bool[2][];

        //第一bundle 包里的资源 是单个资源还是多个资源 true 表示单个
        singles[0] = new bool[1] {
            true
        };
        singles[1] = new bool[1] {
            true
        };
        singles[2] = new bool[1] {
            true
        };
        AssetRequesetMsg tmpMsg = ObjectPoolManager <AssetRequesetMsg> .Instance.GetFreeObject();

        tmpMsg.ChangeEventMsg((ushort)AssetEvent.HunkMutiRes, (ushort)UIPlayerEvent.TeacherLoading, "UIScence", bundle, resName, singles);


        SendMsg(tmpMsg);

        ObjectPoolManager <AssetRequesetMsg> .Instance.ReleaseObject(tmpMsg);
    }
예제 #6
0
    static int set_requesetInfo(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            AssetRequesetMsg  obj  = (AssetRequesetMsg)o;
            AssetRequesetInfo arg0 = (AssetRequesetInfo)ToLua.CheckObject(L, 2, typeof(AssetRequesetInfo));
            obj.requesetInfo = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index requesetInfo on a nil value" : e.Message));
        }
    }
예제 #7
0
    static int get_requesetInfo(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            AssetRequesetMsg  obj = (AssetRequesetMsg)o;
            AssetRequesetInfo ret = obj.requesetInfo;
            ToLua.PushObject(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index requesetInfo on a nil value" : e.Message));
        }
    }
예제 #8
0
    private void GetResoures()
    {
        //        --- 申请多个bundle 里面多个资源

        //-- bundle 对应的名字   以下是二个bundle 包

        string[] bundle =
        {
            "Roles"
        };



        string[][] resName = new string[1][];

        //第一bundle 包里的资源名字
        resName[0] = new string[2] {
            "Magician_idle.prefab", "Swordman_idle.prefab"
        };
        //第二bundle 包里的
        // ------- -----------------------------这里面要加后缀 .prefab   .png----------TestTwo多个情况不用加----------



        bool[][] singles = new bool[1][];

        //第一bundle 包里的资源 是单个资源还是多个资源true 表示单个
        singles[0] = new bool[2] {
            true, true
        };
        //第二bundle 包里的资源 是单个资源还是多个资源true 表示单个


        AssetRequesetMsg tmpMsg = ObjectPoolManager <AssetRequesetMsg> .Instance.GetFreeObject();

        tmpMsg.ChangeEventMsg((ushort)AssetEvent.HunkMutiRes, (ushort)CharactorChooseRoleEvents.Initial, "ChooseRole", bundle, resName, singles);


        SendMsg(tmpMsg);

        ObjectPoolManager <AssetRequesetMsg> .Instance.ReleaseObject(tmpMsg);
    }
예제 #9
0
 static int ChangeEventMsg(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 7);
         AssetRequesetMsg obj  = (AssetRequesetMsg)ToLua.CheckObject(L, 1, typeof(AssetRequesetMsg));
         ushort           arg0 = (ushort)LuaDLL.luaL_checknumber(L, 2);
         ushort           arg1 = (ushort)LuaDLL.luaL_checknumber(L, 3);
         string           arg2 = ToLua.CheckString(L, 4);
         string[]         arg3 = ToLua.CheckStringArray(L, 5);
         string[][]       arg4 = ToLua.CheckObjectArray <string[]>(L, 6);
         bool[][]         arg5 = ToLua.CheckObjectArray <bool[]>(L, 7);
         obj.ChangeEventMsg(arg0, arg1, arg2, arg3, arg4, arg5);
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }