Example #1
0
        void Awake()
        {
//			var ectypeSelectConfigList = EctypeConfigManager.Instance.EctypeSelectConfigList.Values;
//			ectypeSelectConfigList.ApplyAllItem(p=>{
//				GameObject ectypeCard = CreatObjectToNGUI.InstantiateObj(EctypeCardItemPrefab,Grid.transform);
//				EctypeCardItem_V2 ectypeCardItem_V2 = ectypeCard.GetComponent<EctypeCardItem_V2>();
//				ectypeCardItem_V2.Init( EctypeCardItem_V2.CardType.Area, p, OnSelectCardHandle );
//				m_EctypeCardDict.Add(p._lEctypeID, ectypeCardItem_V2);
//			});

            if (EctypeModel.Instance.sMSGEctypeSelect_SC.nEctypeCount == 0)
            {
                return;
            }

            //筛选区域
            List <int> areaIDList = new List <int>();

            EctypeModel.Instance.sMSGEctypeSelect_SC.sMSGEctypeData_SCs.ApplyAllItem(p => {
                if (EctypeConfigManager.Instance.EctypeContainerConfigList[(int)p.dwEctypeContaienrID].AllowCreatTeam == 1)               //判断是否多人副本
                {
                    int areaID = EctypeConfigManager.Instance.GetSelectContainerID((int)p.dwEctypeContaienrID);
                    if (areaID != 0 && !areaIDList.Contains(areaID))
                    {
                        areaIDList.Add(areaID);
                    }
                }
            });
            //创建
            int num = 0;

            areaIDList.ApplyAllItem(p => {
                num++;
                var ectypeSelectConfig = EctypeConfigManager.Instance.EctypeSelectConfigList[p];
                GameObject ectypeCard  = CreatObjectToNGUI.InstantiateObj(EctypeCardItemPrefab, Grid.transform);
                EctypeCardItem_V2 ectypeCardItem_V2 = ectypeCard.GetComponent <EctypeCardItem_V2>();
                ectypeCardItem_V2.Init(EctypeCardItem_V2.CardType.Area, ectypeSelectConfig, OnSelectCardHandle);

                ectypeCard.RegisterBtnMappingId(ectypeSelectConfig._lEctypeID, UIType.TeamInfo, BtnMapId_Sub.TeamInfo_ChangeZone_Confirm);

                int type = num % 3;
                if (type == 1)
                {
                    ectypeCardItem_V2.ShowLeftTip(true);
                }
                else if (type == 0)
                {
                    ectypeCardItem_V2.ShowRightTip(true);
                }
                m_EctypeCardDict.Add(p, ectypeCardItem_V2);
            });

            Grid.Reposition();

            Button_Cancle.SetCallBackFuntion(OnCancleClick, null);
            Button_Sure.SetCallBackFuntion(OnSureClick, null);

            TaskGuideBtnRegister();
        }
Example #2
0
        void Awake()
        {
            for (int i = 0; i < ECTYPE_MAX_NUM; i++)
            {
                GameObject        ectypeCard        = CreatObjectToNGUI.InstantiateObj(EctypeCardItemPrefab, Grid.transform);
                EctypeCardItem_V2 ectypeCardItem_V2 = ectypeCard.GetComponent <EctypeCardItem_V2>();

                //ectypeCardItem_V2.Init( EctypeCardItem_V2.CardType.Ectype, p, OnSelectCardHandle );
                m_EctypeCardList.Add(ectypeCardItem_V2);
            }

            Button_Change.SetCallBackFuntion(OnChangeClick, null);
            Button_Create.SetCallBackFuntion(OnCreateClick, null);
            Button_Hard.SetCallBackFuntion(OnHardClick, null);
            Button_Exit.SetCallBackFuntion(OnExitClick, null);

            TaskGuideBtnRegister();
        }