// 初始化数据 protected override void Awake() { base.Awake(); CatchBtnDesc.text = ULocalizationService.Instance.Get("UIView", "Task", "CatchBtnDesc"); PublishBtnDesc.text = ULocalizationService.Instance.Get("UIView", "Task", "PublishBtnDesc"); //SearchBg.gameObject.SetActive(false); m_listSearchTask = new TaskSearchItem[SEARCH_TASK_COUNT]; for (int i = 0; i < SEARCH_TASK_COUNT; i++) { GameObject taskItemObj = ResNode.InstantiateRes(TaskSearchTemplate); if (!taskItemObj) { return; } m_listSearchTask[i] = taskItemObj.GetComponent <TaskSearchItem>(); if (!m_listSearchTask[i]) { return; } taskItemObj.name = String.Format("TaskSearch{0}", i + 1); m_listSearchTask[i].SetWndView(this); RectTransform taskItemRect = taskItemObj.transform as RectTransform; taskItemRect.SetParent(this.transform, false); taskItemObj.SetActive(false); } TaskSearchTemplate.gameObject.SetActive(false); CatchBtnEffect.color = Color.clear; }
public void DoInitList() { if (m_GenstoneChestFlopList != null) { return; } m_GenstoneChestFlopList = new GenstoneChestFlopItem[m_nFlopItemMax]; TmpFlopItem.SetActive(false); for (int i = 0; i < m_nFlopItemMax; ++i) { GameObject GenstoneChestObject = ResNode.InstantiateRes(TmpFlopItem); if (GenstoneChestObject == null) { return; } GenstoneChestFlopItem item = GenstoneChestObject.GetComponent <GenstoneChestFlopItem>(); if (item == null) { return; } item.Slot = i; GenstoneChestObject.SetActive(true); m_GenstoneChestFlopList[i] = item; GenstoneChestObject.transform.SetParent(FlopListTrans, false); } }
// 初始化 protected override void Awake() { base.Awake(); SubTitle.text = ULocalizationService.Instance.Get("UIView", "Task", "TaskList"); NoDataDesc.text = ULocalizationService.Instance.Get("UIView", "Task", "NoTaskData"); // 初始化任务列表模块 m_listTaskItem = new TaskHoldItem[SINGLE_PAGE_TASK_COUNT]; for (int i = 0; i < SINGLE_PAGE_TASK_COUNT; i++) { GameObject taskItemObj = ResNode.InstantiateRes(TaskItemTemplate); if (!taskItemObj) { return; } m_listTaskItem[i] = taskItemObj.GetComponent <TaskHoldItem>(); if (!m_listTaskItem[i]) { return; } taskItemObj.name = String.Format("TaskHold{0}", i + 1); m_listTaskItem[i].SetWndView(this); RectTransform taskItemRect = taskItemObj.transform as RectTransform; taskItemRect.SetParent(TaskItemFrame, false); } TaskItemTemplate.gameObject.SetActive(false); //m_nCurTaskPage = 1; m_nBtnState = HoldViewBtnState.HVBS_TASK; HoldBtnDesc.text = ULocalizationService.Instance.Get("UIView", "Task", "MyContact"); m_bInitShow = true; }
public override void ProcessNPCResponse(UNPCResponseData data) { m_Title.text = data.npcResp.NpcName; m_Dialog.text = data.npcResp.NpcDialog; // 清空Topic列表 for (int i = m_TopicListTrans.childCount - 1; i >= 0; --i) { var temp = m_TopicListTrans.GetChild(i).gameObject; ResNode.DestroyRes(ref temp); } // 解析生成Topic列表,即NPC功能列表按钮 foreach (var topic in data.npcResp.NPCTopicList) { GameObject topicObj = ResNode.InstantiateRes(DefaultTopicBtn); if (topicObj == null) { continue; } topicObj.SetActive(true); topicObj.transform.SetParent(m_TopicListTrans, false); Button topicBtn = topicObj.GetComponent <Button>(); topicBtn.transform.FindChild("Text").GetComponent <Text>().text = topic.Text; string url = topic.Link; topicBtn.onClick.AddListener(delegate { onClickNPCFunc(url); }); } }
public void AddItem(SSchemeChatEmoticonData _sSchemeData) { if (!m_init) { return; } if (DefaultItem == null) { return; } GameObject itemGO = ResNode.InstantiateRes(DefaultItem); if (itemGO == null) { return; } ChatEmoticonItemBase item = AddEmoticonItemComponent(itemGO, _sSchemeData.eEmoticonType); if (item == null) { return; } item.SetData(_sSchemeData); item.transform.SetParent(ItemContainer, false); item.gameObject.SetActive(true); m_chatEmoticonItemList.Add(item); }
private void Perform(GameObject prefab) { if (this == null) { return; } if (prefab == null) { Trace.Error("AsynGameObject: prefab is null"); return; } GameObject go = ResNode.InstantiateRes(prefab) as GameObject; go.transform.parent = gameObject.transform; go.transform.localScale = new Vector3(1.0f, 1.0f, 1.0f); go.transform.localRotation = Quaternion.identity; go.transform.localPosition = new Vector3(0.0f, 0.0f, 0.0f); //go.transform.rotation = gameObject.transform.rotation; //go.transform.SetPosition( gameObject.transform.position; if (callback != null) { callback.Invoke(gameObject, null); } }
public void onOpenChatWnd(int nSessionID) { if ((nSessionID <= 0) || (nSessionID == LogicDataCenter.snsDataManager.MyBuddyInfo.Info.nUserID)) { Debug.LogError("打开聊天框失败, 传入的SessionID为0或为自己的UserID, nSessionID=" + nSessionID); return; } // 显示窗口,没有就创建窗口 string sessionName = LogicDataCenter.snsDataManager.getSessionName(nSessionID); GameObject subChatWndObj = null; if (!m_subChatWndList.TryGetValue(sessionName, out subChatWndObj)) { subChatWndObj = ResNode.InstantiateRes(ChatWndDefaultITem); subChatWndObj.SetActive(true); subChatWndObj.transform.SetParent(ChatWndDefaultITem.transform.parent, false); m_subChatWndList.Add(sessionName, subChatWndObj); subChatWndObj.GetComponent <SNSChatWndView>().Init(); subChatWndObj.GetComponent <SNSChatWndView>().SessionName = sessionName; subChatWndObj.GetComponent <SNSChatWndView>().SessionID = nSessionID; } subChatWndObj.SetActive(true); // 更新消息显示 subChatWndObj.GetComponent <SNSChatWndView>().onUpdateChatMessage(); // 更新聊听框的好友信息 subChatWndObj.GetComponent <SNSChatWndView>().onUpdateBuddyInfo(); // 移除DIDA提示消息 subChatWndObj.GetComponent <SNSChatWndView>().removeNewMsgDIDA(); }
public void loadLabelEffect(cmd_war_add_label label, int nLabelCount) { SSchemeLabelConfig labelConfig = WarSupportPlayerConfigPage.Instance.GetLabelConfig(label.nLabelID); if (labelConfig == null) { return; } // 格式:“标签名称 +2” string labelStr = labelConfig.labelName + " +" + nLabelCount; Text labelEffectText = ResNode.InstantiateRes <Text>(DefaultLabelEffectText); labelEffectText.gameObject.SetActive(true); labelEffectText.gameObject.transform.SetParent(DefaultLabelEffectText.transform.parent, false); labelEffectText.text = labelStr; // 2s后变透明 DOTween.ToAlpha(() => labelEffectText.color, x => labelEffectText.color = x, 0f, 2f).Play(); // 2s后升高100像素 labelEffectText.transform.DOBlendableLocalMoveBy(new Vector3(0f, 200f, 0), 2f).OnComplete(() => { var temp = labelEffectText.gameObject; ResNode.DestroyRes(ref temp); }); }
public void Init() { m_PermissionList = new Dictionary <int, string> { { (int)EMSNS_PERMISSION_ID.EMSNS_PERMISSION_ID_FILTER_ALL_REQ, ULocalizationService.Instance.Get("UIView", "SNS", "FilterBuddyReq") }, { (int)EMSNS_PERMISSION_ID.EMSNS_PERMISSION_ID_FILTER_ALL_MSG, ULocalizationService.Instance.Get("UIView", "SNS", "FilterBuddyMsg") }, { (int)EMSNS_PERMISSION_ID.EMSNS_PERMISSION_ID_FILTER_TEMP_SESSION, ULocalizationService.Instance.Get("UIView", "SNS", "FilterTempSession") }, { (int)EMSNS_PERMISSION_ID.EMSNS_PERMISSION_ID_DONT_SHOW_OFFLINE_BUDDY, ULocalizationService.Instance.Get("UIView", "SNS", "DontShowOfflineBuddy") }, }; m_PermissionGroup = new Dictionary <int, Toggle>(); foreach (var item in m_PermissionList) { GameObject obj = ResNode.InstantiateRes(DefaultToggle); if (obj == null) { return; } obj.name = item.Key.ToString(); obj.transform.SetParent(DefaultToggle.transform.parent, false); obj.transform.FindChild("Label").GetComponent <Text>().text = item.Value; obj.SetActive(true); Toggle tg = obj.GetComponent <Toggle>(); m_PermissionGroup.Add(item.Key, tg); // 设置复选框状态变化回调 tg.onValueChanged.AddListener(delegate(bool check) { this.onValueChange(check, obj); }); } }
public void init(Transform masterTransform) { if (!masterTransform || !attachBone) { return; } if (effectPrefb == null) { Trace.Log("Sidekick effectPrefb is null!"); return; } if (m_entityObject) { MonoBehaviour.DestroyObject(m_entityObject); m_entityObject = null; } m_entityObject = ResNode.InstantiateRes(effectPrefb) as GameObject; if (!m_entityObject) { return; } m_entityTransoform = m_entityObject.transform; m_entityTransoform.parent = EntityFactory.Instance.transform; m_masterTransoform = masterTransform; m_masterTransoform.SetPosition(attachBone.position + m_masterTransoform.rotation * bornOffset); m_entityTransoform.rotation = m_masterTransoform.rotation; m_Animator = m_entityObject.GetComponent <Animator>(); playAnim(bornAnimation); }
/// <summary> /// 初始化渲染对象列表 /// </summary> public void SetUpMeshDisplayGameObject() { foreach (var renderObj in m_EffectMeshObjectList) { //不能将相机要绑定到的对象绑定给相机 if (renderObj.RenderObject == EffectMeshCamera.AttachObject) { continue; } if (renderObj.RenderObject != null) { var tmpGameObject = renderObj.RenderObject; if (!renderObj.RenderObjectIsSceneObject) { tmpGameObject = ResNode.InstantiateRes(tmpGameObject) as GameObject; renderObj.RenderObjectInstantiate = tmpGameObject; } tmpGameObject.transform.SetParent(EffectMeshCamera.Camera.transform, false); tmpGameObject.transform.localPosition = renderObj.RenderObjectPostion; tmpGameObject.transform.localEulerAngles = renderObj.RenderObjectRotation; tmpGameObject.transform.localScale = renderObj.RenderObjectScale; tmpGameObject.ChangeLayersRecursively(Config.LayerUI); } } }
public void UpdateNavItem(UPromotionNavItem navItem) { if (navItem == null) { return; } if (navItem.nNavID < 1) { return; } int navIndex = m_navIDList.IndexOf(navItem.nNavID); if (navIndex > -1) { UButtonGroupItem btnItem = m_navItemList[navIndex]; if (btnItem != null) { Text navLabel = btnItem.GetComponentInChildren <Text>(); if (navLabel != null) { navLabel.text = navItem.szNavName; } } } else { GameObject go = ResNode.InstantiateRes(DefaultNavItem); if (go == null) { return; } UButtonGroupItem btnItem = go.GetComponent <UButtonGroupItem>(); if (btnItem == null) { return; } Text navLabel = go.GetComponentInChildren <Text>(); if (navLabel == null) { return; } navLabel.text = navItem.szNavName; go.transform.SetParent(NavGroup.transform, false); go.gameObject.SetActive(true); btnItem.Group = NavGroup; btnItem.GroupIndex = navItem.nNavID; btnItem.onSelectedChangedEx.RemoveAllListeners(); btnItem.onSelectedChangedEx.AddListener(OnNavButtonClicked); m_navIDList.Add(navItem.nNavID); m_navItemList.Add(btnItem); } }
public void initVSPlayerInfo() { SummonerReqRes = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, "UI/Prefabs/DynamicState_Moba/WarRecordTable_End/SummonerSkill"); //EquipReqRes = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, "UI/Prefabs/DynamicState_Moba/WarRecordTable_End/EquipInfo"); TitleObjRes = AssetBundleManager.GetAssets(AssetType.Asset_Prefab, "UI/Prefabs/DynamicState_Moba/WarRecordTable_End/Title"); heroHead = this.transform.FindChild("HeroIcon").GetComponent <Image>(); //normalFrame = this.transform.FindChild("HeadFrame").FindChild("Image").GetComponent<Image>(); playerName = this.transform.FindChild("ActorName").GetComponent <Text>(); KDA = this.transform.FindChild("KDA").GetComponent <Text>(); gameMoney = this.transform.FindChild("Money").GetComponent <Text>(); ScoreText = this.transform.FindChild("Score").GetComponent <Text>(); //heroLv = this.transform.FindChild("HeroLv").FindChild("Text").GetComponent<Text>(); selfImage = this.transform.FindChild("SelfImage").gameObject; EquipInfos = new UEquipInfo[EquipCount]; for (int i = 0; i < EquipCount; ++i) { GameObject equipItemObj = ResNode.InstantiateRes(EquipTemplate); if (!equipItemObj) { return; } equipItemObj.SetActive(true); equipItemObj.name = "EquipItem" + (i + 1); equipItemObj.transform.SetParent(EquipTemplate.transform.parent, false); EquipInfos[i] = equipItemObj.GetComponent <UEquipInfo>(); } // 设置初始状态,如果预制体是当从缓存中取出的,则还保留上次的数据 SetInitData(); }
void GenerateBirdGroups() { birdgroups.Clear(); GameObject birdgroupprefab = Resources.Load("Birds Swarm/Swarm Orbit Center") as GameObject; if (birdgroupprefab == null) { return; } if (birdswarmgroups == null) { birdswarmgroups = new GameObject("birdgroups"); } int n = 10; float range = 100.0f; for (int i = 0; i < n; i++) { GameObject birdgroup = ResNode.InstantiateRes(birdgroupprefab); birdgroup.SetActive(true); birdgroup.name = "birdgroup_" + i.ToString(); Vector3 pos; pos.x = UnityEngine.Random.Range(-range, range); pos.y = UnityEngine.Random.Range(5, 10); pos.z = UnityEngine.Random.Range(-range, range); birdgroup.transform.SetPosition(pos); birdgroup.transform.parent = birdswarmgroups.transform; birdgroups.Add(birdgroup); } }
public void openInputDialog(SNSOpenInputDialogMsgData msgData) { // 判断是否可以创建新的输入窗口 if (msgData.type != SNSOpenInputDialogMsgData.EMDialogType.EM_COMMON) { if (m_InputDialogList.ContainsKey((int)msgData.type)) { return; } } SNSInputDialogSubWndView dialog = ResNode.InstantiateRes <SNSInputDialogSubWndView>(DefaultInputDialog); if (dialog == null) { return; } dialog.Init(msgData.type, msgData.title, msgData.defaultText, msgData.placeHolderText); dialog.OnConfirmClick = msgData.onClickDelegate; dialog.OnCloseClick = onInputDialogClose; m_InputDialogList.Add((int)msgData.type, dialog); dialog.transform.SetParent(DefaultInputDialog.transform.parent, false); dialog.gameObject.SetActive(true); // 全选输入框所有内容 dialog.SelectAllInputFiledContent(); }
public ListRuneGetWaysItem InitItemViewInfo(string sShowText) { if (string.IsNullOrEmpty(sShowText)) { return(null); } if (DefaultGetWaysItem == null) { return(null); } GameObject getWaysObj = ResNode.InstantiateRes(DefaultGetWaysItem); if (!getWaysObj) { return(null); } ListRuneGetWaysItem item = getWaysObj.GetComponent <ListRuneGetWaysItem>(); if (item == null) { return(null); } getWaysObj.SetActive(true); getWaysObj.transform.SetParent(this.transform, false); item.InitItemViewInfo(sShowText); return(item); }
private void SetPrizeData(int[] nPrizeID, int nPrizeIDLen) { m_personalPrizeItems = new LegendCupPrizeItem[nPrizeIDLen]; for (int i = 0; i < nPrizeIDLen; i++) { GameObject PersonalPrizeObj = ResNode.InstantiateRes(PersonalPrizeTemplate); if (!PersonalPrizeObj) { return; } RectTransform rectTrans = PersonalPrizeObj.transform as RectTransform; rectTrans.SetParent(PersonalPrizeFrame, false); m_personalPrizeItems[i] = LogicDataCenter.legendCupDataManager.CreateLegendCupPrizeItem(rectTrans); if (!m_personalPrizeItems[i]) { return; } m_personalPrizeItems[i].SetData(nPrizeID[i]); } PersonalPrizeTemplate.SetActive(false); }
public void InitDefaultNavList() { m_navItemList.Clear(); m_navIDList.Clear(); m_builtInNavMethodMap.Clear(); List <SchemeWebUrlNode> urlNodeList = SchemeWebUrl.Instance.SchemeWebUrlNodeList; for (int i = 0; i < urlNodeList.Count; i++) { SchemeWebUrlNode node = urlNodeList[i]; if (node == null) { continue; } GameObject go = ResNode.InstantiateRes(DefaultNavItem); if (go == null) { continue; } UButtonGroupItem btnItem = go.GetComponent <UButtonGroupItem>(); if (btnItem == null) { continue; } Text navLabel = go.GetComponentInChildren <Text>(); if (navLabel == null) { continue; } if (node.nClientFuncType > 0 && !m_builtInNavMethodMap.ContainsKey(node.nId)) { m_builtInNavMethodMap.Add(node.nId, node.nClientFuncType); } navLabel.text = node.szName; go.transform.SetParent(NavGroup.transform); go.gameObject.SetActive(true); btnItem.Group = NavGroup; btnItem.GroupIndex = i; btnItem.onSelectedChangedEx.RemoveAllListeners(); btnItem.onSelectedChangedEx.AddListener(OnNavButtonClicked); m_navIDList.Add(node.nId); m_navItemList.Add(btnItem); if (i == 0) { m_curNavID = node.nId; btnItem.Selected = true; } } }
public void OnShowLegndCupPrizeWnd(long lLegendCupID) { cmd_legendcup_recv_cuplist_node cupBaseData = LogicDataCenter.legendCupDataManager.GetSingleLegendCupNode(lLegendCupID); if (cupBaseData.nLegendCupID == 0) { return; } TotalBonusCount.text = cupBaseData.nCompetitionBonus.ToString(); // 清空DetailPrizeFrame int nCount = DetailPrizeFrame.childCount; for (int j = nCount - 1; j >= 0; j--) { Transform childTrans = DetailPrizeFrame.GetChild(j); if (childTrans) { var temp = childTrans.gameObject; ResNode.DestroyRes(ref temp); } } SSchemeLegendCupConfig cupConfig = LegendCupConfig.Instance.GetCupConfig(cupBaseData.nCupConfigID); if (cupConfig == null) { return; } List <SSchemeLegendCupPrizeConfig> prizeConfigList = LegendCupConfig.Instance.GetCupPrizeConfig(cupConfig.nPrizeConfigID); if (prizeConfigList == null) { return; } m_DetailPrizeItems = new LegendCupDetailPrizeItem[prizeConfigList.Count]; for (int i = 0; i < prizeConfigList.Count; i++) { GameObject detailPrizeObj = ResNode.InstantiateRes(DetailPrizeTemplate); if (!detailPrizeObj) { return; } RectTransform rectTrans = detailPrizeObj.transform as RectTransform; rectTrans.SetParent(DetailPrizeFrame, false); m_DetailPrizeItems[i] = detailPrizeObj.GetComponent <LegendCupDetailPrizeItem>(); if (!m_DetailPrizeItems[i]) { return; } m_DetailPrizeItems[i].SetData(prizeConfigList[i], cupBaseData.nCompetitionBonus); } DetailPrizeTemplate.SetActive(false); }
public void OnShowKinMemberWnd(int nKinID) { // 清空KinMemberFrame int nCount = KinMemberListFrame.childCount; for (int i = nCount - 1; i >= 0; --i) { Transform childTrans = KinMemberListFrame.GetChild(i); if (childTrans) { var temp = childTrans.gameObject; ResNode.DestroyRes(ref temp); } } // 填充数据 List <cmd_legendcup_competition_kinmembernode> memberList = LogicDataCenter.legendCupDataManager.GetKinMemberInfo(nKinID); if (memberList == null) { return; } KinMemberTemplate.SetActive(true); cmd_legendcup_recv_regist_memberlistnode tempNode = new cmd_legendcup_recv_regist_memberlistnode(); m_kinMemberItems = new LegendCupRegistKinMemberItem[memberList.Count]; for (int i = 0; i < memberList.Count; ++i) { GameObject memberItemObj = ResNode.InstantiateRes(KinMemberTemplate); if (!memberItemObj) { return; } m_kinMemberItems[i] = memberItemObj.GetComponent <LegendCupRegistKinMemberItem>(); if (!m_kinMemberItems[i]) { return; } tempNode.uDBID = memberList[i].nUserID; tempNode.nPDBID = memberList[i].nPDBID; tempNode.nActorSex = memberList[i].nActorSex; tempNode.nActorLevel = memberList[i].nActorLevel; tempNode.szActorName = memberList[i].szActorName; tempNode.nType = memberList[i].nType; tempNode.nRankGrade = memberList[i].nRankGrade; tempNode.nRankScore = memberList[i].nRankScore; tempNode.nRankIconId = memberList[i].nRankIconId; tempNode.szGradeName = memberList[i].szGradeName; m_kinMemberItems[i].SetData(tempNode); memberItemObj.name = "MemberItem" + (i + 1); RectTransform rectTrans = memberItemObj.transform as RectTransform; rectTrans.SetParent(KinMemberListFrame, false); } KinMemberTemplate.SetActive(false); }
// 复制物件 public virtual ILoudspeakerItem Clone() { GameObject newObj = ResNode.InstantiateRes(m_obj.gameObject); LoudspeakerItemText newItem = newObj.GetComponent <LoudspeakerItemText>(); newItem.SetItemData(m_itemData); return(newItem); }
private void UpdateServerList(List <gamelogic_district_info> groupList) { int nCount = ServerList.transform.childCount; for (int i = nCount - 1; i >= 0; --i) { Transform childTrans = ServerList.transform.GetChild(i); if (childTrans) { GameObject go = childTrans.gameObject; // 销毁obj ResNode.DestroyRes(ref go); } } for (int i = 0; i < groupList.Count; i++) { GameObject serverGo = ResNode.InstantiateRes(DefaultServerItem); if (serverGo != null) { serverGo.transform.SetParent(ServerList.transform, false); serverGo.GetComponent <UButtonGroupItem>().Group = ServerList; serverGo.SetActive(true); Text btnLabel = serverGo.GetComponentInChildren <Text>(); if (btnLabel) { btnLabel.text = groupList[i].szName; } //正常 if (groupList[i].nState < 2) { Transform icon_Green = serverGo.transform.FindChild("Icon_Green"); if (icon_Green) { icon_Green.gameObject.SetActive(true); } } else//爆满 { Transform icon_Red = serverGo.transform.FindChild("Icon_Red"); if (icon_Red) { icon_Red.gameObject.SetActive(true); } } DistrictInfo districtInfo = serverGo.GetComponent <DistrictInfo>(); if (districtInfo != null) { districtInfo.SetData(i, groupList[i].nGroup, groupList[i].nDistrict, groupList[i].nServer); } } } }
public void OnShowCreateTypeWnd() { int nTypeCount = CupTypeFrame.childCount; for (int i = nTypeCount - 1; i >= 0; i--) { Transform typeRect = CupTypeFrame.GetChild(i); if (typeRect) { var temp = typeRect.gameObject; ResNode.DestroyRes(ref temp); } } List <SSchemeLegendCupTypeConfig> typeConfigList = LegendCupConfig.Instance.GetCupTypeConfigList(); if (typeConfigList == null || typeConfigList.Count <= 0) { return; } m_typeItem.Clear(); int index = 0; CupTypeBtnGroup.UseGroupIndex = true; foreach (SSchemeLegendCupTypeConfig config in typeConfigList) { if (config.nIsShow <= 0) { continue; } GameObject typeObj = ResNode.InstantiateRes(CupTypeTemplate); if (!typeObj) { return; } RectTransform typeTrans = typeObj.transform as RectTransform; typeTrans.SetParent(CupTypeFrame, false); LegendCupTypeItem typeItem = typeObj.GetComponent <LegendCupTypeItem>(); typeItem.SetData(this, config.nCreateType); m_typeItem.Add(typeItem); UButtonGroupItem btnItem = typeObj.GetComponent <UButtonGroupItem>(); btnItem.GroupIndex = index++; btnItem.Group = CupTypeBtnGroup; typeObj.SetActive(true); } CupTypeTemplate.SetActive(false); CupTypeBtnGroup.onButtonGroupSelectedChange.RemoveListener(OnButtonChange); CupTypeBtnGroup.onButtonGroupSelectedChange.AddListener(OnButtonChange); CupTypeBtnGroup.SetItemSelectedItem(0); }
/// <summary> /// 创建顶部标签元素 /// </summary> /// <returns></returns> public UWarGoodsStoreTabItem SetGoodsStoreTabItem(string _strLocalFilter, string _strLocalKey, int _nDispositionID, UnityAction <UButtonGroupItem, bool> _actionSelected) { UWarGoodsStoreTabItem tmpItem = ResNode.InstantiateRes <UWarGoodsStoreTabItem>(DefaultTabItem.gameObject, true); if (tmpItem != null) { tmpItem.gameObject.SetActive(true); tmpItem.Init(_strLocalFilter, _strLocalKey, _nDispositionID, _actionSelected, GoodsStoreTab); } return(tmpItem); }
private void InitEmoticonGroup(int serialID, List <SSchemeChatEmoticonData> emoticonList) { int index = serialID == 1 ? 0 : 1; if (emoticonList == null || emoticonList.Count < 1) { return; } if (emoticonGroupGO[index] == null || emoticonTabPageRTList[index] == null) { return; } GameObject groupGO = ResNode.InstantiateRes(emoticonGroupGO[index]); if (groupGO == null) { return; } ChatEmoticonGroup emoGroup = groupGO.GetComponent <ChatEmoticonGroup>(); if (emoGroup == null) { return; } groupGO.transform.SetParent(emoticonTabPageRTList[index], false); groupGO.SetActive(true); if (emoticonList[0] == null) { return; } if (!emoGroup.Init(serialID, emoticonList[0].nEmoticonSellID, true)) { return; } foreach (SSchemeChatEmoticonData emoData in emoticonList) { emoGroup.AddItem(emoData); } if (!m_chatEmoticonGroupList.ContainsKey(serialID)) { m_chatEmoticonGroupList.Add(serialID, emoGroup); } emoGroup.SetLockState(LogicDataCenter.emojiDataManager.CheckEmojiGroupLocked(serialID)); }
public void UpdateLastEnterDistrictList() { int nCount = LastEnterServerList.transform.childCount; for (int i = nCount - 1; i >= 0; --i) { Transform childTrans = LastEnterServerList.transform.GetChild(i); if (childTrans) { GameObject go = childTrans.gameObject; // 销毁obj ResNode.DestroyRes(ref go); } } m_lastEnterDistrictList = DataCenter.LogicDataCenter.districtListDataManger.LastEnterDistrictInfoList; if (m_lastEnterDistrictList == null || m_lastEnterDistrictList.Count < 1) { return; } for (int i = 0; i < m_lastEnterDistrictList.Count; i++) { //最多列5个 if (i > 5) { break; } GameObject serverGo = ResNode.InstantiateRes(DefaultLastServerItem); if (serverGo != null) { serverGo.transform.SetParent(LastEnterServerList.transform, false); serverGo.GetComponent <UButtonGroupItem>().Group = LastEnterServerList; serverGo.SetActive(true); Text btnLabel = serverGo.GetComponentInChildren <Text>(); if (btnLabel) { btnLabel.text = m_lastEnterDistrictList[i].szName; } DistrictInfo districtInfo = serverGo.GetComponent <DistrictInfo>(); if (districtInfo != null) { districtInfo.SetData(i, m_lastEnterDistrictList[i].nGroup, m_lastEnterDistrictList[i].nDistrict, m_lastEnterDistrictList[i].nServer); } } } }
public void SetGuideItemFrame(int nTypeId) { SSchemeGuideType guideTypeConfig = ConsumptionGuideConfig.Instance.GetGuideType(nTypeId); if (guideTypeConfig == null) { return; } GuideTitle.text = guideTypeConfig.strGuideTitle; int nItemCount = GuideItemFrame.childCount; for (int i = nItemCount - 1; i >= 0; --i) { Transform childTrans = GuideItemFrame.GetChild(i); if (childTrans) { var temp = childTrans.gameObject; ResNode.DestroyRes(ref temp); } } for (int i = 0; i < guideTypeConfig.guideWndList.Count; i++) { GameObject itemObj = ResNode.InstantiateRes(GuideItemTemplate); if (!itemObj) { return; } RectTransform itemRect = itemObj.transform as RectTransform; if (!itemRect) { return; } itemRect.SetParent(GuideItemFrame, false); ConsumptionGuideWndItem itemItem = itemObj.GetComponent <ConsumptionGuideWndItem>(); if (!itemItem) { return; } itemItem.SetData(this, guideTypeConfig.guideWndList[i].nGuideDesc, LogicDataCenter.taskDataManager.CTaskGuideManager.GuideHandlerMap[guideTypeConfig.guideWndList[i].nGuideWnd]); } GuideItemTemplate.SetActive(false); }
public void OnRecvRegistKinMemberList(int nKinID) { SingleRegistKinMemberInfo memberlist = LogicDataCenter.legendCupDataManager.GetSingleRegistKinMemberInfo(nKinID); if (memberlist == null) { return; } // 清空KinMemberFrame int nCount = KinMemberListFrame.childCount; for (int i = nCount - 1; i >= 0; --i) { Transform childTrans = KinMemberListFrame.GetChild(i); if (childTrans) { var temp = childTrans.gameObject; ResNode.DestroyRes(ref temp); } } KinMemberTemplate.SetActive(true); m_kinMemberItems = new LegendCupRegistKinMemberItem[memberlist.headInfo.nMemberCount]; for (int i = 0; i < memberlist.headInfo.nMemberCount; ++i) { GameObject memberItemObj = ResNode.InstantiateRes(KinMemberTemplate); if (!memberItemObj) { return; } m_kinMemberItems[i] = memberItemObj.GetComponent <LegendCupRegistKinMemberItem>(); if (!m_kinMemberItems[i]) { return; } m_kinMemberItems[i].SetData(memberlist.nodeInfo[i]); memberItemObj.name = "MemberItem" + (i + 1); RectTransform rectTrans = memberItemObj.transform as RectTransform; rectTrans.SetParent(KinMemberListFrame, false); } KinMemberTemplate.SetActive(false); }
public override bool Init(IUIWnd wnd) { // 创建HonorItem HonorItem = new UHonorItem[nItemInPage]; for (int i = 0; i < nItemInPage; ++i) { GameObject HonorItemObj = ResNode.InstantiateRes(HonorItemTemplate); if (!HonorItemObj) { return(false); } HonorItem[i] = HonorItemObj.GetComponent <UHonorItem>(); if (!HonorItem[i]) { return(false); } HonorItemObj.name = "HonorItem" + (i + 1); RectTransform rectTrans = HonorItemObj.transform as RectTransform; rectTrans.SetParent(HonorItemFrame, false); } HonorItemTemplate.SetActive(false); // label ViewTitle.text = ULocalizationService.Instance.Get("UIView", "HonorPageView", "title"); TotalKillLabel.text = ULocalizationService.Instance.Get("UIView", "HonorPageView", "totalKill"); TotalGameLabel.text = ULocalizationService.Instance.Get("UIView", "HonorPageView", "totalGame"); KillFirstLabel.text = ULocalizationService.Instance.Get("UIView", "HonorPageView", "killFirst"); PentaKillLabel.text = ULocalizationService.Instance.Get("UIView", "HonorPageView", "pentaKill"); QuadraKillLabel.text = ULocalizationService.Instance.Get("UIView", "HonorPageView", "quadraKill"); TribleKillLabel.text = ULocalizationService.Instance.Get("UIView", "HonorPageView", "tribleKill"); GodLikeLabel.text = ULocalizationService.Instance.Get("UIView", "HonorPageView", "godLike"); // 数据 curHonorPage = 1; maxHonorPage = (int)SHOWINDEX.ENACHIEVE_MAX / nItemInPage; if ((int)SHOWINDEX.ENACHIEVE_MAX / nItemInPage != 0) { maxHonorPage++; } table = new int[(int)SHOWINDEX.ENACHIEVE_MAX]; return(base.Init(wnd)); }
protected override void Awake() { base.Awake(); // GroupMemberFrame m_kinItemList = new LegendCupBigKnockoutKinItem[KIN_ITEM_COUNT]; for (int i = 0; i < KIN_ITEM_COUNT; ++i) { GameObject memberItemObj = ResNode.InstantiateRes(GroupMemberTemplate); if (!memberItemObj) { return; } memberItemObj.name = "GroupMemberItem" + (i + 1); RectTransform rectTrans = memberItemObj.transform as RectTransform; rectTrans.SetParent(GroupMemberFrame, false); m_kinItemList[i] = memberItemObj.GetComponent <LegendCupBigKnockoutKinItem>(); if (!m_kinItemList[i]) { return; } } GroupMemberTemplate.SetActive(false); // CompetitionNodeFrame m_nodeItemList = new LegendCupCompetitionNodeItem[NODE_ITEM_COUNT]; for (int j = 0; j < NODE_ITEM_COUNT; ++j) { GameObject nodeItemObj = ResNode.InstantiateRes(CompetitionNodeTemplate); if (!nodeItemObj) { return; } nodeItemObj.name = "CompetitionNodeItem" + (j + 1); RectTransform rectTrans = nodeItemObj.transform as RectTransform; rectTrans.SetParent(CompetitionNodeFrame, false); m_nodeItemList[j] = nodeItemObj.GetComponent <LegendCupCompetitionNodeItem>(); if (!m_nodeItemList[j]) { return; } } CompetitionNodeTemplate.SetActive(false); }