public override void CallWhenCreate()
    {
        AttachLogicUnit(NewChallengeUILogicManager.Instance);

        RegisterButtonHandler("NewChallengeUIClose");
        SetButtonClickHandler("NewChallengeUIClose", OnCloseUp);

        for (int i = 0; i < 4; ++i)
        {
            MFUIUtils.AttachWidget(MFUIGameObjectPool.GetSingleton().GetGameObject(string.Concat("NewChallengeUIGrid", i)).transform,
                                   GetTransform("NewChallengeUIGridListTop").transform);

            MFUIGameObjectPool.GetSingleton().GetGameObject(string.Concat("NewChallengeUIGrid", i)).transform.localPosition =
                new Vector3(m_fGridListStartPos + m_fGridListWidth * i, 0, 0);

            m_listNewChallengeGrid.Add(MFUIGameObjectPool.GetSingleton().GetGameObject(
                                           string.Concat("NewChallengeUIGrid", i)).AddComponent <NewChallengeGrid>());
        }

        for (int i = 0; i < 4; ++i)
        {
            MFUIUtils.AttachWidget(MFUIGameObjectPool.GetSingleton().GetGameObject(string.Concat("NewChallengeUIGrid", 4 + i)).transform,
                                   GetTransform("NewChallengeUIGridListBottom").transform);

            MFUIGameObjectPool.GetSingleton().GetGameObject(string.Concat("NewChallengeUIGrid", 4 + i)).transform.localPosition =
                new Vector3(m_fGridListStartPos + m_fGridListWidth * i, 0, 0);

            m_listNewChallengeGrid.Add(MFUIGameObjectPool.GetSingleton().GetGameObject(
                                           string.Concat("NewChallengeUIGrid", 4 + i)).AddComponent <NewChallengeGrid>());
        }
    }
Example #2
0
        private void AddStrenthFX(uint fxId)
        {
            //Debug.Log("@@@@@@@@AddStrenthFX(" + fxId+")");
            if (fxId == m_oldStrenthFXID)
            {
                return;
            }

            int fxResId = EquipSpecialEffectData.dataMap[(int)fxId].fxid;

            m_oldStrenthFXID = loadedStrengthenId;

            System.Collections.Generic.List <GameObject> listGo = GameObject.GetComponent <ActorParent>().WeaponObj;

            if (fxId != 0)
            {
                AssetCacheMgr.GetInstance("H_blade_01_fx_6.prefab", (name, id, obj) =>
                {
                    for (int i = 0; i < listGo.Count; ++i)
                    {
                        int index = i;
                        MFUIUtils.AttachWidget(((GameObject)obj).transform, listGo[index].transform);
                    }
                });
            }
            else
            {
            }
        }
 public override void CallWhenLoadResources()
 {
     m_instance = this;
     ID         = MFUIManager.MFUIID.NewChargeRewardUI;
     MFUIManager.GetSingleton().RegisterUI(ID, m_myGameObject);
     m_myGameObject.name = "NewChargeRewardUI";
     MFUIUtils.AttachWidget(m_myTransform, GameObject.Find("MogoMainUIPanel").transform);
     MFUIGameObjectPool.GetSingleton().NotRegisterGameObjectList(ID);
 }
 public override void CallWhenLoadResources()
 {
     m_instance = this;
     AttachLogicUnit(InvitFriendMessageBoxLogicManager.Instance);
     ID = MFUIManager.MFUIID.InvitFriendMessageBox;
     m_myGameObject.name = "InvitFriendMessageBox";
     MFUIManager.GetSingleton().RegisterUI(ID, m_myGameObject);
     MFUIUtils.AttachWidget(m_myTransform, GameObject.Find("MogoMainUIPanel").transform);
     MFUIGameObjectPool.GetSingleton().NotRegisterGameObjectList(ID);
 }
 public override void CallWhenLoadResources()
 {
     m_instance          = this;
     ID                  = MFUIManager.MFUIID.BattlePassUINoCard;
     m_myGameObject.name = "BattlePassUINoCard";
     AttachLogicUnit(BattlePassUINoCardUILogicManager.Instance);
     MFUIManager.GetSingleton().RegisterUI(ID, m_myGameObject);
     MFUIUtils.AttachWidget(m_myTransform, GameObject.Find("MogoMainUIPanel").transform);
     MFUIGameObjectPool.GetSingleton().NotRegisterGameObjectList(ID);
 }
    public void AddChargePriceItem(List <string> itemText)
    {
        ClearChargePriceItem();

        int page = itemText.Count / 6 + 1;

        if (page > 2)
        {
            int offset = page - 2;

            for (int i = 0; i < offset; ++i)
            {
                GameObject go = new GameObject();
                go.transform.localPosition = new Vector3(655 * (i + 2), 0, 0);
                GetTransform("NewChargeRewardUIProgressGridListCam").GetComponentsInChildren <MyDragableCamera>(true)[0].transformList.Add(go.transform);
            }
        }
        for (int i = 0; i < itemText.Count; ++i)
        {
            int index = i;

            AssetCacheMgr.GetUIInstance("NewChargeRewardUIProgressGrid.prefab", (name, id, obj) =>
            {
                GameObject itemGo = (GameObject)obj;
                MFUIUtils.AttachWidget(itemGo.transform, GetTransform("NewChargeRewardUIProgressGridList"));
                itemGo.transform.localPosition = new Vector3(-273 + index * 109f, 0, 0);
                itemGo.transform.localScale    = Vector3.one;

                itemGo.GetComponentsInChildren <MogoSingleButton>(true)[0].ButtonListTransform = GetTransform("NewChargeRewardUIProgressGridList");
                GetTransform("NewChargeRewardUIProgressGridList").GetComponentsInChildren <MogoSingleButtonList>(true)[0].SingleButtonList.Add(itemGo.GetComponentsInChildren <MogoSingleButton>(true)[0]);

                itemGo.GetComponentsInChildren <MyDragCamera>(true)[0].RelatedCamera = GetTransform("NewChargeRewardUIProgressGridListCam").GetComponentsInChildren <Camera>(true)[0];

                itemGo.transform.FindChild("NewChargeRewardUIProgressGridBtn/NewChargeRewardUIProgressGridBtnText").GetComponentsInChildren <UILabel>(true)[0].text = itemText[index];

                itemGo.transform.FindChild("NewChargeRewardUIProgressGridBtn").GetComponentsInChildren <MFUIButtonHandler>(true)[0].ClickHandler = OnProgressGridUp;

                itemGo.transform.FindChild("NewChargeRewardUIProgressGridBtn").GetComponentsInChildren <MFUIButtonHandler>(true)[0].ID = index;

                //if (itemText.Count <= 6)
                //{
                //    GetTransform("NewChargeRewardUIProgressGridListCam").GetComponentsInChildren<MyDragableCamera>(true)[0].MAXX = 0;
                //}
                //else
                //{
                //    GetTransform("NewChargeRewardUIProgressGridListCam").GetComponentsInChildren<MyDragableCamera>(true)[0].MAXX =
                //        109f * (itemText.Count-6);
                //}

                m_listPriceItem.Add(itemGo);
            });
        }
    }
Example #7
0
    public override void CallWhenLoadResources()
    {
        m_instance = this;
        ID         = MFUIManager.MFUIID.DragonUI;
        MFUIManager.GetSingleton().RegisterUI(ID, m_myGameObject);

        MFUIResourceManager.GetSingleton().PreLoadResource("DragonUIGridInfotest.prefab", ID);
        MFUIResourceManager.GetSingleton().PreLoadResource("fx_ui_longyujiemian_qiu.prefab", ID);
        MFUIResourceManager.GetSingleton().PreLoadResource("fx_ui_longyujiemian_jb.prefab", ID);

        MFUIGameObjectPool.GetSingleton().NotRegisterGameObjectList(MFUIManager.MFUIID.DragonUI);

        MFUIUtils.AttachWidget(m_myTransform, GameObject.Find("MogoMainUIPanel").transform);
        m_myGameObject.name = "DragonUI";
    }
    // void Awake()
    public override void CallWhenLoadResources()
    {
        ID = MFUIManager.MFUIID.RuneUI;
        MFUIManager.GetSingleton().RegisterUI(ID, m_myGameObject);
        m_myGameObject.name = "RuneUI";
        m_myTransform       = transform;

        m_instance = this;

        Initialize();
        FillFullNameData(m_myTransform);


        MFUIUtils.AttachWidget(m_myTransform, GameObject.Find("MogoMainUIPanel").transform);
        MFUIGameObjectPool.GetSingleton().NotRegisterGameObjectList(ID);
    }
    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 void SetTipRewardList(List <string> listReward)
    {
        if (listReward == null)
        {
            return;
        }

        for (int i = 0; i < listReward.Count; ++i)
        {
            int index = i;
            AssetCacheMgr.GetUIInstance("ProtectGodressTipReward.prefab", (name, id, go) =>
            {
                GameObject gameObj = (GameObject)go;
                gameObj.name       = string.Concat("ProtectGodressTipReward", index);
                MFUIUtils.AttachWidget(gameObj.transform, GetTransform("ProtectGodressTipRewardList"));
                gameObj.transform.localPosition = new Vector3(-520, -GridHeight * index, 0);

                UILabel lblText = gameObj.transform.FindChild("ProtectGodressTipRewardText").GetComponentsInChildren <UILabel>(true)[0];
                lblText.text    = listReward[index];
                //GameObject goDOT1 = gameObj.transform.FindChild("ProtectGodressTipRewardDOT1").gameObject;
                //GameObject goDOT2 = gameObj.transform.FindChild("ProtectGodressTipRewardDOT2").gameObject;

                if (listReward.Count > 5)
                {
                    GetTransform("ProtectGodressTipRewardListCam").GetComponent <MyDragableCamera>().MINY =
                        OffsetY - (listReward.Count - 5) * GridHeight;
                }
                else
                {
                    GetTransform("ProtectGodressTipRewardListCam").GetComponent <MyDragableCamera>().MINY = OffsetY;
                }

                m_listReward.Add(gameObj);
            });
        }
    }
    public void RefreshWingGridList(System.Collections.Generic.List <WingGridData> dataList)
    {
        for (int i = 0; i < gridList.Count; ++i)
        {
            AssetCacheMgr.ReleaseInstance(gridList[i].gameObject);
        }

        gridList.Clear();
        GetTransform("WingUIListDialogGridList").GetComponent <MogoSingleButtonList>().SingleButtonList.Clear();
        GetTransform("WingUIListDialogGridListCamera").localPosition = new Vector3(0, -166f, 0);

        for (int i = 0; i < dataList.Count; ++i)
        {
            int index = i;
            AssetCacheMgr.GetUIInstance("WingUIListDialogGrid.prefab", (name, id, go) =>
            {
                GameObject gameObj = (GameObject)go;
                MFUIUtils.AttachWidget(gameObj.transform, GetTransform("WingUIListDialogGridList"));
                gameObj.transform.localPosition = new Vector3(0, -112 * index, 0);
                gameObj.GetComponent <MyDragCamera>().RelatedCamera = GetTransform("WingUIListDialogGridListCamera").GetComponent <Camera>();
                GetTransform("WingUIListDialogGridList").GetComponent <MogoSingleButtonList>().SingleButtonList.Add(
                    gameObj.GetComponent <MogoSingleButton>());
                WingUIGrid uigrid = gameObj.AddComponent <WingUIGrid>();
                uigrid.ID         = index;

                WingGridData data = dataList[index];

                if (data.IsHave == false)
                {
                    uigrid.ShowBuyBtn(true);
                    uigrid.ShowUsedSign(false);
                    uigrid.SetWingCost(data.WingPrice);
                    uigrid.SetWingName(data.WingName);
                    uigrid.SetWingStatus(data.WingStatus);
                    uigrid.SetWingDescripte(data.WingDescripe);
                    uigrid.ShowWingLock(false);
                    uigrid.ShowWingProgress(false);
                    uigrid.ShowWingIconBlackWhite(true);
                    uigrid.ShowCost(true);
                }
                else
                {
                    if (data.IsActive == true)
                    {
                        if (data.IsUsing == false)
                        {
                            uigrid.ShowBuyBtn(false);
                            uigrid.ShowUsedSign(false);
                            uigrid.SetWingName(data.WingName);
                            uigrid.SetWingStatus(data.WingStatus);
                            uigrid.SetWingDescripte(data.WingDescripe);
                            uigrid.ShowWingLock(false);
                            //uigrid.ShowWingProgress(false);
                            uigrid.ShowWingProgress(true);
                            uigrid.SetWingProgressText(string.Concat(data.WingCurExp, "/", data.WingTotalExp));
                            uigrid.SetWingProgressSize((float)data.WingCurExp / (float)data.WingTotalExp);
                            uigrid.ShowWingIconBlackWhite(false);
                            uigrid.ShowCost(false);
                        }
                        else
                        {
                            uigrid.ShowBuyBtn(false);
                            uigrid.ShowUsedSign(true);
                            uigrid.SetWingName(data.WingName);
                            uigrid.SetWingStatus(data.WingStatus);
                            uigrid.SetWingDescripte(data.WingDescripe);
                            uigrid.ShowWingLock(false);
                            uigrid.ShowWingProgress(true);
                            uigrid.SetWingProgressText(string.Concat(data.WingCurExp, "/", data.WingTotalExp));
                            uigrid.SetWingProgressSize((float)data.WingCurExp / (float)data.WingTotalExp);
                            uigrid.ShowWingIconBlackWhite(false);
                            uigrid.ShowCost(false);
                        }
                    }
                    else
                    {
                        uigrid.ShowBuyBtn(false);
                        uigrid.ShowUsedSign(false);
                        uigrid.SetWingName(data.WingName);
                        uigrid.SetWingStatus(data.WingStatus);
                        uigrid.SetWingDescripte(data.WingDescripe);
                        uigrid.ShowWingLock(true);
                        uigrid.ShowWingProgress(false);
                        uigrid.ShowWingIconBlackWhite(false);
                        uigrid.ShowCost(false);
                    }
                }


                if (dataList.Count <= 4)
                {
                    GetTransform("WingUIListDialogGridListCamera").GetComponent <MyDragableCamera>().MINY =
                        -166f;
                }
                else
                {
                    GetTransform("WingUIListDialogGridListCamera").GetComponent <MyDragableCamera>().MINY =
                        -166f - (dataList.Count - 4) * 112f;
                }

                gridList.Add(gameObj);
            });
        }
    }
    public void RefreshGridList(List <NewLoginRewardGridData> list)
    {
        if (m_listRewardGrid.Count > 0)
        {
            return;
        }

        for (int i = 0; i < list.Count; ++i)
        {
            int index = i;

            AssetCacheMgr.GetUIInstance("NewLoginRewardUIRewardGrid.prefab", (name, id, go) =>
            {
                GameObject gameObj = (GameObject)go;
                gameObj.name       = string.Concat("NewLoginRewardUIRewardGrid", index);
                MFUIUtils.AttachWidget(gameObj.transform, GetTransform("NewLoginRewardUIRewardList"));
                gameObj.transform.localPosition = new Vector3(0, -index * 120f, 0);
                gameObj.transform.localScale    = Vector3.one;
                gameObj.GetComponentsInChildren <MyDragCamera>(true)[0].RelatedCamera = GetTransform("NewLoginRewardUIRewardListCam").GetComponentsInChildren <Camera>(true)[0];
                NewLoginRewardUIRewardGrid grid = gameObj.AddComponent <NewLoginRewardUIRewardGrid>();
                gameObj.transform.FindChild("NewLoginRewardUIGetBtn").GetComponentsInChildren <MFUIButtonHandler>(true)[0].ID           = index;
                gameObj.transform.FindChild("NewLoginRewardUIGetBtn").GetComponentsInChildren <MFUIButtonHandler>(true)[0].ClickHandler = OnGetBtnUp;

                grid.SetDays(list[index].strDays);
                if (list[index].IsGot)
                {
                    grid.ShowItemGotSign(true);
                    grid.ShowSendToMailText(false);
                    grid.ShowGetBtn(false);
                }
                else
                {
                    if (list[index].IsSendToMailBox)
                    {
                        grid.ShowItemGotSign(false);
                        grid.ShowSendToMailText(true);
                        grid.ShowGetBtn(false);
                    }
                    else
                    {
                        grid.ShowGetBtn(true);
                        grid.ShowItemGotSign(false);
                        grid.ShowSendToMailText(false);
                    }
                }

                for (int j = 0; j < 5; ++j)
                {
                    if (j < list[index].listItemID.Count)
                    {
                        grid.ShowItemGrid(true, j);

                        //grid.SetItemImg(list[index].listItemImg[j], j);
                        grid.SetItemID(list[index].listItemID[j], j);
                        grid.SetItemNum(list[index].listItemNum[j].ToString(), j);
                    }
                    else
                    {
                        grid.ShowItemGrid(false, j);
                    }
                }

                if (list.Count > 4)
                {
                    GetTransform("NewLoginRewardUIRewardListCam").GetComponentsInChildren <MyDragableCamera>(true)[0].MINY = -180f - 120f * (list.Count - 4);
                }
                else
                {
                    GetTransform("NewLoginRewardUIRewardListCam").GetComponentsInChildren <MyDragableCamera>(true)[0].MINY = -180f;
                }

                m_listRewardGrid.Add(gameObj);
            });
        }
    }
    public void RefreshFXGrid(System.Collections.Generic.List <EquipFXUIGridData> list)
    {
        for (int i = 0; i < m_listFXGrid.Count; ++i)
        {
            AssetCacheMgr.ReleaseInstance(m_listFXGrid[i]);
        }

        m_listFXGrid.Clear();
        m_listCanActiveFXID.Clear();
        GetTransform("EquipFXUIDialogFXGridList").GetComponentsInChildren <MogoSingleButtonList>(true)[0].SingleButtonList.Clear();
        GetTransform("EquipFXUIDialogFXGridListCam").localPosition = new Vector3(0, -200f, 0);

        bool isNextShowAsQuestionMark = false;

        for (int i = 0; i < list.Count; ++i)
        {
            int index = i;

            AssetCacheMgr.GetUIInstance("EquipFXUIDialogFXGrid.prefab", (name, id, go) =>
            {
                GameObject gameObj = (GameObject)go;

                gameObj.name       = string.Concat("EquipFXUIDialogFXGrid", index);
                EquipFXUIGrid grid = gameObj.AddComponent <EquipFXUIGrid>();
                grid.SetGotText(list[index].gridText);
                grid.SetIconFG(list[index].gridIcon);

                if (!isNextShowAsQuestionMark)
                {
                    grid.SetNotGetText(list[index].gridText);
                }
                else
                {
                    grid.SetNotGetText("???");
                }

                if (list[index].gridProgressSize > 1f)
                {
                    grid.SetPrgressSize(1);
                }
                else
                {
                    grid.SetPrgressSize(list[index].gridProgressSize);
                }
                grid.SetProgressText(list[index].gridProgressText);
                grid.ID = index;
                grid.SetActiveBtnUpHandler(OnActiveBtnUp);
                grid.GetComponentsInChildren <MFUIButtonHandler>(true)[0].ID           = index;
                grid.GetComponentsInChildren <MFUIButtonHandler>(true)[0].ClickHandler = OnFXGridUp;

                if (list[index].isActive)
                {
                    grid.ShowActiveBtn(false);
                    grid.ShowGotText(true);
                    grid.ShowNotGetText(false);
                    //grid.SetActiveBtnText(LanguageData.GetContent(7532));
                    grid.ShowProgress(false);
                    grid.ShowGetSign(true);
                }
                else
                {
                    if (list[index].gridProgressSize >= 1f)
                    {
                        grid.ShowActiveBtn(true);
                        grid.ShowGotText(false);
                        grid.ShowNotGetText(true);
                        grid.SetActiveBtnText(LanguageData.GetContent(7532));
                        grid.ShowProgress(true);
                        grid.ShowGetSign(false);
                        m_listCanActiveFXID.Add(index);
                    }
                    else
                    {
                        grid.ShowActiveBtn(true);
                        grid.ShowProgress(true);
                        grid.ShowGotText(false);
                        grid.ShowNotGetText(true);
                        grid.ShowGetSign(false);

                        grid.SetActiveBtnText(LanguageData.GetContent(7533));
                    }

                    isNextShowAsQuestionMark = true;
                }

                gameObj.GetComponentsInChildren <MyDragCamera>(true)[0].RelatedCamera =
                    GetTransform("EquipFXUIDialogFXGridListCam").GetComponentsInChildren <Camera>(true)[0];

                GetTransform("EquipFXUIDialogFXGridList").GetComponentsInChildren <MogoSingleButtonList>(true)[0].SingleButtonList.Add(
                    gameObj.GetComponentsInChildren <MogoSingleButton>(true)[0]);

                MFUIUtils.AttachWidget(gameObj.transform, GetTransform("EquipFXUIDialogFXGridList"));
                gameObj.transform.localPosition = new Vector3(0, -135f * index, 0);
                gameObj.transform.localScale    = Vector3.one;

                if (list.Count > 4)
                {
                    GetTransform("EquipFXUIDialogFXGridListCam").GetComponentsInChildren <MyDragableCamera>(true)[0].MINY =
                        -200f - 135f * (list.Count - 4);
                }
                else
                {
                    GetTransform("EquipFXUIDialogFXGridListCam").GetComponentsInChildren <MyDragableCamera>(true)[0].MINY = -200f;
                }

                m_listFXGrid.Add(gameObj);
            });
        }
    }
 void OnTest1Loaded()
 {
     goTest = MFUIGameObjectPool.GetSingleton().GetGameObject("goTest");
     MFUIUtils.AttachWidget(goTest.transform, m_myTransform.parent);
 }