Beispiel #1
0
        private void UpdateEctypeList()
        {
            var playerData = PlayerManager.Instance.FindHeroDataModel();
            int index      = 0;

            m_CrusadeList = EctypeConfigManager.Instance.EctypeSelectConfigList.Values.Where(p => p.lEctypeType == 9).ToList();          //首领讨伐副本 lEctypeType = 9
            bool isCreate = true;

            m_CrusadeList.ApplyAllItem(p => {
                p._vectContainer.ApplyAllItem(k => {
                    if (isCreate)
                    {
                        EctypeContainerData ectypeContainerData = EctypeConfigManager.Instance.EctypeContainerConfigList[k];
                        if (!m_ectypeItemList.ContainsKey(k))
                        {
                            index++;
                            GameObject ectype = UI.CreatObjectToNGUI.InstantiateObj(CrusadeLeaderItemPrefab, Grid.transform);
                            CrusadeLeaderItem crusadeLeaderItem = ectype.GetComponent <CrusadeLeaderItem>();
                            crusadeLeaderItem.Init(p._EctypeIconPrefab, ectypeContainerData, playerData.UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL, OnSelectEctypeClick, index);
                            ectype.RegisterBtnMappingId(p._lEctypeID, UIType.Crusade, BtnMapId_Sub.Crusade_EctypeItem);
                            m_ectypeItemList.Add(k, crusadeLeaderItem);
                        }
                        if (ectypeContainerData.lMinActorLevel > playerData.UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL)
                        {
                            isCreate = false;
                        }
                    }
                });
            });
            Grid.Reposition();

            m_ectypeItemList.Values.ApplyAllItem(p => p.UpdateInfo(playerData.UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL));
        }
Beispiel #2
0
        void Awake()
        {
            var playerData = PlayerManager.Instance.FindHeroDataModel();

            RewardItemButton.SetCallBackFuntion(OnRewardItemClick);
            m_CrusadeList = EctypeConfigManager.Instance.EctypeSelectConfigList.Values.Where(p => p.lEctypeType == 9).ToList();          //首领讨伐副本 lEctypeType = 9
            bool isCreate = true;
            int  index    = 0;

            m_CrusadeList.ApplyAllItem(p => {
                p._vectContainer.ApplyAllItem(k => {
                    if (isCreate)
                    {
                        index++;
                        GameObject ectype = UI.CreatObjectToNGUI.InstantiateObj(CrusadeLeaderItemPrefab, Grid.transform);
                        EctypeContainerData ectypeContainerData = EctypeConfigManager.Instance.EctypeContainerConfigList[k];
                        CrusadeLeaderItem crusadeLeaderItem     = ectype.GetComponent <CrusadeLeaderItem>();
                        crusadeLeaderItem.Init(p._EctypeIconPrefab, ectypeContainerData, playerData.UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL, OnSelectEctypeClick, index);
                        ectype.RegisterBtnMappingId(p._lEctypeID, UIType.Crusade, BtnMapId_Sub.Crusade_EctypeItem);
                        m_ectypeItemList.Add(k, crusadeLeaderItem);
                        if (ectypeContainerData.lMinActorLevel > playerData.UnitValues.sMsgPropCreateEntity_SC_UnitVisibleValue.UNIT_FIELD_LEVEL)
                        {
                            isCreate = false;
                        }
                    }
                });
            });
            Grid.Reposition();

            GameObject commonTitle = UI.CreatObjectToNGUI.InstantiateObj(CommonPanelTitlePrefab, CommonPanelTitlePoint);

            m_CommonPanelTitle         = commonTitle.GetComponent <BaseCommonPanelTitle>();
            m_CommonPanelTitle.HidePos = new Vector3(100, 0, 0);
            m_CommonPanelTitle.ShowPos = Vector3.zero;
            m_CommonPanelTitle.Init(CommonTitleType.Power, CommonTitleType.GoldIngot);

            Button_Exit.SetCallBackFuntion(OnExitClick, null);
            Button_ViewDrops.SetPressCallBack(OnViewRewardsClick);
            Button_Start.SetCallBackFuntion(OnStartClick, null);
            Button_CreateTeam.SetCallBackFuntion(OnCreateTeamClick, null);
            Button_FindTeam.SetCallBackFuntion(OnFindTeamClick, null);
            Button_QuickJoin.SetCallBackFuntion(OnQuickJoinClick, null);

            Button_Receive.SetCallBackFuntion(OnReceiveFirstRewardClick, null);
            Button_RandomEctype.SetCallBackFuntion(OnRandomEctypeClick, null);
            Button_CancelRandomEctype.SetCallBackFuntion(OnCancelRandomEctypeClick, null);
            Button_CancelRandomEctype.gameObject.SetActive(false);


            LeaderListPanelPos  = LeaderListPanel.transform.localPosition;
            CrusadeInfoPanelPos = CrusadeInfoPanel.transform.localPosition;

            TaskGuideBtnRegister();

            RegisterEventHandler();
        }