/// <summary> /// UI关闭 /// </summary> public void UIActveFalse() { transform.localScale = Vector3.zero; SettingLinkEntity settingLinkEntity = (SettingLinkEntity)GetComponent <SettingLinkViewModel>().DataEntity; settingLinkEntity.isShow = false; //得到当前基站的信息 ObjectPool <TowerModel> pool = InjectService.Get <ObjectPool <TowerModel> >(); foreach (var key in pool.objectsDic.Keys) { pool.objectsDic[key].transform.GetChild(2).GetComponent <Renderer>().material.color = Color.yellow; } }
/// <summary> /// 刷数据 /// </summary> /// <param name="showNames"></param> private void UpdateDropdownView(SettingLinkViewModel settinglinkModel, SettingLinkEntity settinglinkEntity) { showNames = new List <string>(); Dropdown dropdownItem = settinglinkModel.transform.Find("Tower/Dropdown").GetComponent <Dropdown>(); dropdownItem.options.Clear(); Dropdown.OptionData tempData; ObjectPool <TowerModel> pool = InjectService.Get <ObjectPool <TowerModel> >(); pool.Foreach(ForeachPool); for (int i = 0; i < showNames.Count; i++) { tempData = new Dropdown.OptionData(); tempData.text = showNames[i]; dropdownItem.options.Add(tempData); } if (showNames.Count > 0) { dropdownItem.captionText.text = showNames[0]; } settinglinkEntity.dropdown = 0; }
/// <summary> /// 设置连接 /// </summary> public void SettingLink() { SettingLinkEntity settingLinkEntity = (SettingLinkEntity)FindObjectOfType <SettingLinkViewModel>().DataEntity; settingLinkEntity.isShow = !settingLinkEntity.isShow; }