public override void CallWhenLoadResources()
    {
        m_instance = this;
        ID         = MFUIManager.MFUIID.NewChallengeUI;
        MFUIManager.GetSingleton().RegisterUI(ID, m_myGameObject);
        MFUIUtils.AttachWidget(m_myTransform, GameObject.Find("MogoMainUIPanel").transform);
        m_myGameObject.name = "NewChallengeUI";
        //MFUIGameObjectPool.GetSingleton().NotRegisterGameObjectList(ID);

        System.Collections.Generic.List <MFUIResourceReqInfo> listInfo = new System.Collections.Generic.List <MFUIResourceReqInfo>();

        for (int i = 0; i < 8; ++i)
        {
            int index = i;
            MFUIResourceReqInfo info = new MFUIResourceReqInfo();
            info.id     = ID;
            info.path   = "NewChallengeUIGrid.prefab";
            info.goName = string.Concat("NewChallengeUIGrid", index);
            listInfo.Add(info);
        }
        MFUIGameObjectPool.GetSingleton().RegisterGameObjectList(listInfo, null, true);
    }
    public override void CallWhenLoadResources()
    {
        m_instance = this;
        ID = MFUIManager.MFUIID.NewChallengeUI;
        MFUIManager.GetSingleton().RegisterUI(ID, m_myGameObject);
        MFUIUtils.AttachWidget(m_myTransform, GameObject.Find("MogoMainUIPanel").transform);
        m_myGameObject.name = "NewChallengeUI";
        //MFUIGameObjectPool.GetSingleton().NotRegisterGameObjectList(ID);

         System.Collections.Generic.List<MFUIResourceReqInfo> listInfo = new System.Collections.Generic.List<MFUIResourceReqInfo>();

        for(int i = 0;i < 8;++i)
        {
             int index = i;
            MFUIResourceReqInfo info = new MFUIResourceReqInfo();
            info.id = ID;
            info.path = "NewChallengeUIGrid.prefab";
            info.goName = string.Concat("NewChallengeUIGrid", index);
            listInfo.Add(info);


        }
        MFUIGameObjectPool.GetSingleton().RegisterGameObjectList(listInfo, null, true);
    }
Exemple #3
0
    public void SwitchUIWithLoad(MFUIID targetUIID, MFUIID baseUIID              = MFUIID.None, uint pri = 0, bool isAttached = false,
                                 MFUISwitchAnim.MFUISwitchAnimType switchInType  = MFUISwitchAnim.MFUISwitchAnimType.None,
                                 MFUISwitchAnim.MFUISwitchAnimType switchOutType = MFUISwitchAnim.MFUISwitchAnimType.None)
    {
        //Debug.LogError(targetUIID + " " + CurrentUI);
        if (m_bUICanChange == false)
        {
            return;
        }

        if (CurrentUI == targetUIID)
        {
            return;
        }

        if (DictUIIDToOBj.ContainsKey(CurrentUI) && !isAttached)
        {
            DictUIIDToOBj[CurrentUI].GetComponentsInChildren <MFUIUnit>(true)[0].Hide();
            //Debug.LogError(CurrentUI + " Hide");
        }

        if (targetUIID == MFUIID.None)
        {
            MogoGlobleUIManager.Instance.ShowWaitingTip(false);
            CurrentUI = MFUIID.None;
            return;
        }

        MFUIQueueManager.Instance.PushOne(() =>
        {
            if (!DictUIIDToOBj.ContainsKey(targetUIID))
            {
                List <MFUIResourceReqInfo> list = new List <MFUIResourceReqInfo>();

                MFUIResourceReqInfo info = new MFUIResourceReqInfo();

                info.path   = DictUIIDToPathName[targetUIID];
                info.goName = targetUIID.ToString();
                info.id     = targetUIID;

                list.Add(info);

                MFUIGameObjectPool.GetSingleton().RegisterGameObjectList(list, () =>
                {
                    switch (targetUIID)
                    {
                    case MFUIID.DragonUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <DragonUIViewManager>();
                        break;

                    case MFUIID.RuneUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <RuneUIViewManager>();
                        break;

                    //case MFUIID.NewBattleRewardUI:
                    //    MFUIGameObjectPool.GetSingleton().GetGameObject("go~").AddComponent<NewBattleRewardUIViewManager>();
                    //    break;

                    case MFUIID.PassCountDownUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <PassCountDownUIViewManager>();
                        break;

                    case MFUIID.BattlePassUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <BattlePassUIViewManager>();
                        break;

                    case MFUIID.BattlePassCardListUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <BattlePassCardListUIViewManager>();
                        break;

                    case MFUIID.OgreMustDieTip:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <OgreMustDieTipViewManager>();
                        break;

                    case MFUIID.InvitFriendMessageBox:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <InvitFriendMessageBoxViewManager>();
                        break;

                    case MFUIID.InvitFriendListUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <InvitFriendListUIViewManager>();
                        break;

                    case MFUIID.EnterWaittingMessageBox:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <EnterWaittingMessageBoxViewManager>();
                        break;

                    case MFUIID.BattlePassUINoCard:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <BattlePassUINoCardUIViewManager>();
                        break;

                    case MFUIID.NewChallengeUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <NewChallengeUIViewManager>();
                        break;

                    case MFUIID.WingUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <WingUIViewManager>();
                        break;

                    case MFUIID.WingPreviewInMarketUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <WingUIPreviewInMarketUIViewManager>();
                        break;

                    case MFUIID.ProtectGodressTip:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <ProtectGodressTipViewManager>();
                        break;

                    case MFUIID.EquipFXUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <EquipFXUIViewManager>();
                        break;

                    case MFUIID.WingUIUpgradeDialog:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <WingUIUpgradeDialogViewManager>();
                        break;

                    case MFUIID.WingUIBuyDialog:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <WingUIBuyDialogViewManager>();
                        break;

                    case MFUIID.RewardUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <RewardUIViewManager>();
                        break;

                    case MFUIID.ChargeReturnWingUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <ChargeReturnWingUIViewManager>();
                        break;

                    case MFUIID.ElfDiamondUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <ElfDiamondUIViewManager>();
                        break;

                    case MFUIID.NewChargeRewardUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <NewChargeRewardUIViewManager>();
                        break;

                    case MFUIID.NewLoginRewardUI:
                        MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent <NewLoginRewardUIViewManager>();
                        break;
                    }
                    SwitchUI(targetUIID, baseUIID, pri, isAttached, switchInType, switchOutType);
                });
            }
            else
            {
                SwitchUI(targetUIID, baseUIID, pri, isAttached, switchInType, switchOutType);
            }
        }, baseUIID, pri, targetUIID.ToString());
    }
Exemple #4
0
    public void SwitchUIWithLoad(MFUIID targetUIID, MFUIID baseUIID = MFUIID.None, uint pri = 0,bool isAttached = false,
        MFUISwitchAnim.MFUISwitchAnimType switchInType = MFUISwitchAnim.MFUISwitchAnimType.None,
        MFUISwitchAnim.MFUISwitchAnimType switchOutType = MFUISwitchAnim.MFUISwitchAnimType.None)
    {
        //Debug.LogError(targetUIID + " " + CurrentUI);
        if (m_bUICanChange == false)
            return;

        if (CurrentUI == targetUIID)
            return;

        if (DictUIIDToOBj.ContainsKey(CurrentUI) && !isAttached)
        { 
            DictUIIDToOBj[CurrentUI].GetComponentsInChildren<MFUIUnit>(true)[0].Hide();
            //Debug.LogError(CurrentUI + " Hide");
        }

        if (targetUIID == MFUIID.None)
        {
            MogoGlobleUIManager.Instance.ShowWaitingTip(false);
            CurrentUI = MFUIID.None;
            return;
        }

        MFUIQueueManager.Instance.PushOne(() =>
            {
                if (!DictUIIDToOBj.ContainsKey(targetUIID))
                {

                    List<MFUIResourceReqInfo> list = new List<MFUIResourceReqInfo>();

                    MFUIResourceReqInfo info = new MFUIResourceReqInfo();

                    info.path = DictUIIDToPathName[targetUIID];
                    info.goName = targetUIID.ToString();
                    info.id = targetUIID;

                    list.Add(info);

                    MFUIGameObjectPool.GetSingleton().RegisterGameObjectList(list, () =>
                    {
                        switch (targetUIID)
                        {
                            case MFUIID.DragonUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<DragonUIViewManager>();
                                break;

                            case MFUIID.RuneUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<RuneUIViewManager>();
                                break;

                            //case MFUIID.NewBattleRewardUI:
                            //    MFUIGameObjectPool.GetSingleton().GetGameObject("go~").AddComponent<NewBattleRewardUIViewManager>();
                            //    break;

                            case MFUIID.PassCountDownUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<PassCountDownUIViewManager>();
                                break;

                            case MFUIID.BattlePassUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<BattlePassUIViewManager>();
                                break;

                            case MFUIID.BattlePassCardListUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<BattlePassCardListUIViewManager>();
                                break;

                            case MFUIID.OgreMustDieTip:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<OgreMustDieTipViewManager>();
                                break;

                            case MFUIID.InvitFriendMessageBox:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<InvitFriendMessageBoxViewManager>();
                                break;

                            case MFUIID.InvitFriendListUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<InvitFriendListUIViewManager>();
                                break;

                            case MFUIID.EnterWaittingMessageBox:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<EnterWaittingMessageBoxViewManager>();
                                break;

                            case MFUIID.BattlePassUINoCard:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<BattlePassUINoCardUIViewManager>();
                                break;

                            case MFUIID.NewChallengeUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<NewChallengeUIViewManager>();
                                break;

                            case MFUIID.WingUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<WingUIViewManager>();
                                break;

                            case MFUIID.WingPreviewInMarketUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<WingUIPreviewInMarketUIViewManager>();
                                break;
                                
                            case MFUIID.ProtectGodressTip:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<ProtectGodressTipViewManager>();
                                break;

                            case MFUIID.EquipFXUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<EquipFXUIViewManager>();
                                break;

                            case MFUIID.WingUIUpgradeDialog:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<WingUIUpgradeDialogViewManager>();
                                break;

                            case MFUIID.WingUIBuyDialog:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<WingUIBuyDialogViewManager>();
                                break;

                            case MFUIID.RewardUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<RewardUIViewManager>();
                                break;

                            case MFUIID.ChargeReturnWingUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<ChargeReturnWingUIViewManager>();
                                break;

                            case MFUIID.ElfDiamondUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<ElfDiamondUIViewManager>();
                                break;

                            case MFUIID.NewChargeRewardUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<NewChargeRewardUIViewManager>();
                                break;

                            case MFUIID.NewLoginRewardUI:
                                MFUIGameObjectPool.GetSingleton().GetGameObject(targetUIID.ToString()).AddComponent<NewLoginRewardUIViewManager>();
                                break;

                        }
                        SwitchUI(targetUIID, baseUIID, pri, isAttached, switchInType, switchOutType);
                    });
                }
                else
                {

                    SwitchUI(targetUIID, baseUIID, pri, isAttached, switchInType, switchOutType);
                }
            }, baseUIID, pri, targetUIID.ToString());

    }