public override void ProcessEvent(MsgBase msg)
    {
        switch (msg.msgId)
        {
        case  (ushort)LoadingEvent.Initial:
        {
        }
        break;

        case  (ushort)LoadingEvent.Loading:
        {
            Debug.Log(" bundle  comback !!");

            AssetResponseMsg tmpMsg = (AssetResponseMsg)msg;

            // Resources.load
            UnityEngine.Object[] tmpObj = tmpMsg.GetBundleRes("Loading", "Loading.prefab");


            GameObject tmpGame = GameObject.Instantiate(tmpObj[0])  as  GameObject;



            tmpObj = tmpMsg.GetBundleRes("Regist", "Regist.prefab");

            tmpGame = GameObject.Instantiate(tmpObj[0]) as GameObject;
        }
        break;


        default:
            break;
        }
    }
Exemple #2
0
 static int DebugBundle(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         AssetResponseMsg obj = (AssetResponseMsg)ToLua.CheckObject(L, 1, typeof(AssetResponseMsg));
         obj.DebugBundle();
         return(0);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #3
0
 static int GetBundleName(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 1);
         AssetResponseMsg obj = (AssetResponseMsg)ToLua.CheckObject(L, 1, typeof(AssetResponseMsg));
         string[]         o   = obj.GetBundleName();
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #4
0
    public override void ProcessEvent(MsgBase msg)
    {
        switch (msg.msgId)
        {
        case (ushort)TestBagEvents.Initial:
        {
            Debug.Log("Shop  Initial  coming1!!");
        }
        break;

        case (ushort)TestShopEvents.GetResources:
        {
            AssetResponseMsg tmpMsg = (AssetResponseMsg)msg;

            //  Resource.load ()
            UnityEngine.Object[] objs = tmpMsg.GetBundleRes("Loading", "Loading.prefab");


            GameObject loadObj = InitialPanle(objs[0]);


            Initial(loadObj.transform);


            AddButtonLisenter("Regist", ClickRegist);



            objs = tmpMsg.GetBundleRes("Registing", "Registing.prefab");


            GameObject registObj = InitialPanle(objs[0]);


            // GameObject  loadObj = GameObject.Instantiate(objs[0]) as GameObject;



            // Debug.Log(loadObj.name+"======================");
        }
        break;

        default:
            break;
        }
    }
Exemple #5
0
 static int GetBundleRes(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         AssetResponseMsg     obj  = (AssetResponseMsg)ToLua.CheckObject(L, 1, typeof(AssetResponseMsg));
         string               arg0 = ToLua.CheckString(L, 2);
         string               arg1 = ToLua.CheckString(L, 3);
         UnityEngine.Object[] o    = obj.GetBundleRes(arg0, arg1);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #6
0
 static int GetBundleResByIndex(IntPtr L)
 {
     try
     {
         ToLua.CheckArgsCount(L, 3);
         AssetResponseMsg obj   = (AssetResponseMsg)ToLua.CheckObject(L, 1, typeof(AssetResponseMsg));
         int arg0               = (int)LuaDLL.luaL_checknumber(L, 2);
         int arg1               = (int)LuaDLL.luaL_checknumber(L, 3);
         UnityEngine.Object[] o = obj.GetBundleResByIndex(arg0, arg1);
         ToLua.Push(L, o);
         return(1);
     }
     catch (Exception e)
     {
         return(LuaDLL.toluaL_exception(L, e));
     }
 }
Exemple #7
0
    public override void ProcessEvent(MsgBase msg)
    {
        switch (msg.msgId)
        {
        case (ushort)UIDemoLoading.GetResources:
        {
            AssetResponseMsg tmpMsg = (AssetResponseMsg)msg;

            //Resources.load
            UnityEngine.Object[] tmpObjs = tmpMsg.GetBundleRes("Loading", "Loading.prefab");


            GameObject tmpGameObj = InitialPanle(tmpObjs[0]);


            loadingCtr.LoadingObj = tmpGameObj;

            Initial(tmpGameObj.transform);

            InitialLogic();



            UnityEngine.Object[] tmpRejest = tmpMsg.GetBundleRes("Regist", "Regist.prefab");

            loadingCtr.SettingObj(tmpRejest[0]);
        }
        break;

        case (ushort)UIDemoLoading.Initial:
        {
        }
        break;


        case (ushort)UIDemoLoading.ShowPanel:
        {
            Debug.Log("Show panel  recv");
            loadingCtr.ShowPanle();
        }
        break;

        default:
            break;
        }
    }
Exemple #8
0
    public void ResLoadFinish(BundleBackNode node)
    {
        bundleCount++;



        if (bundleCount == bundleNode.Length)
        {
//            Debug.Log("bundleCount==" + bundleCount);
//            Debuger.Log("hunck   the whole Bundle  back ==" + node.bundleName);

            AssetResponseMsg tmpResponse = new AssetResponseMsg(this);
            assetBase.SendMsg(tmpResponse);


            requesetCallBack(this);
        }
    }
Exemple #9
0
    public override void ProcessEvent(MsgBase msg)
    {
        switch (msg.msgId)
        {
        case (ushort)CharactorChooseRoleEvents.Initial:
            //加载两个角色模型,其中一个是未激活状态
            AssetResponseMsg     tmpMsg         = (AssetResponseMsg)msg;
            UnityEngine.Object[] magicianObjs   = tmpMsg.GetBundleRes("Roles", "Magician_idle.prefab");
            UnityEngine.Object[] swordmanObjs   = tmpMsg.GetBundleRes("Roles", "Swordman_idle.prefab");
            GameObject           tmpMagicianObj = GameObject.Instantiate(magicianObjs[0], Vector3.zero, Quaternion.identity) as GameObject;
            GameObject           tmpSwordmanObj = GameObject.Instantiate(swordmanObjs[0], Vector3.zero, Quaternion.identity) as GameObject;
            tmpMagicianObj.transform.Rotate(Vector3.up, 180);
            tmpSwordmanObj.transform.Rotate(Vector3.up, 180);
            tmpSwordmanObj.SetActive(false);

            characters = new GameObject[] { tmpMagicianObj, tmpSwordmanObj };
            roleStr.InitialGameObject(characters);

            break;

        case (ushort)CharactorChooseRoleEvents.GetResource:

            break;

        case (ushort)CharactorChooseRoleEvents.PrevBtn:
            //Debug.Log("受到lua");
            roleStr.OnPrevButtonClick();
            break;

        case (ushort)CharactorChooseRoleEvents.NextBtn:
            roleStr.OnNextButtonClick();
            break;

        case (ushort)CharactorChooseRoleEvents.AcceptBtn:
            Debug.Log("accept coming !!");
            break;

        default:
            break;
        }
    }
Exemple #10
0
    static int _CreateAssetResponseMsg(IntPtr L)
    {
        try
        {
            int count = LuaDLL.lua_gettop(L);

            if (count == 1)
            {
                BundleRequest    arg0 = (BundleRequest)ToLua.CheckObject(L, 1, typeof(BundleRequest));
                AssetResponseMsg obj  = new AssetResponseMsg(arg0);
                ToLua.PushObject(L, obj);
                return(1);
            }
            else
            {
                return(LuaDLL.luaL_throw(L, "invalid arguments to ctor method: AssetResponseMsg.New"));
            }
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e));
        }
    }
Exemple #11
0
    public override void ProcessEvent(MsgBase msg)
    {
        switch (msg.msgId)
        {
        case (ushort)UIPlayerEvent.TeacherLoading:
        {
            AssetResponseMsg respones = (AssetResponseMsg)msg;

            //Resources.load 代替
            UnityEngine.Object[] tmpObj = respones.GetBundleRes("Loading", "Loading.prefab");



            GameObject tmpGame = InitialPanle(tmpObj[0]);
            this.Initial(tmpGame.transform.parent);
            InitialLogic();



            //regist
            UnityEngine.Object[] tmpRegist = respones.GetBundleRes("Registing", "Registing.prefab");



            logicCtr.RegistPanle = tmpRegist[0];
            //   UnityEngine.Object[] tmpLevel = respones.GetBundleRes("Scences", "Test.unity");



            // logicCtr.RegistPanle = tmpRegist[0];
        }
        break;

        default:
            break;
        }
    }