Пример #1
0
    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;
        }
    }
Пример #2
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;
        }
    }
Пример #3
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;
        }
    }
Пример #4
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;
        }
    }
Пример #5
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;
        }
    }
Пример #6
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));
     }
 }