//当前点,点击保存后回调刷新 void SaveToRefresh(string message) { transform.Find("Panel (1)").gameObject.SetActive(false); Enums.MatchigPointGizmoControll controll = (Enums.MatchigPointGizmoControll)Enum.Parse(typeof(Enums.MatchigPointGizmoControll), message); int group = PointHelper.GetInstance().currentgroup; int index = PointHelper.GetInstance().currentindex; if (buttonmap == null || buttonmap.Count == 0) { RefreshViewByNormalModleData(); } MatchingItemButton it = SearchHelper.GetInstance().SerchChoise(buttonmap, group, index); if (!it) { return; } switch (controll) { case Enums.MatchigPointGizmoControll.SaveMatchingpoint: it.SaveMatchingpoint(); break; case Enums.MatchigPointGizmoControll.Cancle: it.Cancle(); break; default: break; } }
void SetLastMatchingItem(MatchingItemButton item) { if (lastchoiseitem) { lastchoiseitem.CheckMeNeedCancle(); } toolpanel.SetActive(true); this.lastchoiseitem = item; }
void AutoNext(string message) { int group = PointHelper.GetInstance().currentgroup; int index = PointHelper.GetInstance().currentindex; MatchingItemButton b = SearchHelper.GetInstance().SerchChoise(buttonmap, group, index); b.OnEditHit(); }
MatchingItemButton GetMatchingItem(int group, int index) { MatchingItemButton mib = null; if (buttonmap.ContainsKey(group) && buttonmap[group].ContainsKey(index)) { mib = buttonmap[group][index]; } return(mib); }
/// <summary> /// 根据normalmodledata数据刷新两列button /// </summary> public void RefreshViewByNormalModleData() { Clear(); pointmap = PointHelper.GetInstance().normaldataformlocaljson;//PointHelper.GetInstance().normalmodelInSceneMap; if (null == pointmap || pointmap.Count == 0) { Debug.LogError("pointmap 为空!!!"); return; } foreach (KeyValuePair <int, Dictionary <int, Vector3> > item in pointmap) { int group = item.Key; GameObject but = SpawnChildren(Groupbuttonitem); Button b = but.GetComponent <Button>(); string groupstr = Tool.NumberToChar(group + 1).ToUpper(); b.GetComponentInChildren <Text>().text = groupstr; b.onClick.AddListener(() => { ResetLastAndSetThis(b); if (dropdownindex == 0) { MSGCenter.Execute(Enums.PointControll.Choise.ToString(), group.ToString()); } ChoisePanel(b); choiseindex = group; }); if (group == choiseindex) { ChoisePanel(b); lastchoiselistbutton = b; } Dictionary <int, Vector3> templist = item.Value; List <GameObject> tempgos = new List <GameObject>(); List <MatchingItemButton> tempbuts = new List <MatchingItemButton>(); foreach (KeyValuePair <int, Vector3> it in templist) { GameObject g = SpawnChildren(Pointbuttonitem); g.SetActive(false); int tempgroup = group; int tempindex = it.Key; g.GetComponentInChildren <Text>().text = groupstr + " " + (tempindex + 1).ToString(); MatchingItemButton Matchingitem = g.GetComponent <MatchingItemButton>(); Matchingitem.Init(tempgroup, tempindex, SetLastMatchingItem); tempgos.Add(g); tempbuts.Add(Matchingitem); } listmap.Add(b, tempgos); buttonmap.Add(group, tempbuts); buttonindex.Add(group, b); } RefreshViewByUserModelData(); }
/// <summary> /// 根据normalmodledata数据刷新两列button /// </summary> public void RefreshViewByNormalModleData() { Dictionary <int, Dictionary <int, Vector3> > normalpointmap = PlayerDataCenter.Instance.Currentnormalpointmap; if (null == normalpointmap || normalpointmap.Count == 0) { Debug.LogError("pointmap 为空!!!"); return; } foreach (KeyValuePair <int, Dictionary <int, Vector3> > item in normalpointmap) { int group = item.Key; GameObject but = SpawnChildren(SpawnChild.FirstPoolItem, Groupbuttonitem.transform.parent); but.transform.SetAsLastSibling(); Button b = but.GetComponent <Button>(); string groupstr = Tool.NumberToChar(group + 1).ToUpper(); b.GetComponentInChildren <Text>().text = groupstr; b.onClick.AddListener(() => { ResetLastGroupItem(b, group); ChoisePanel(b); }); Dictionary <int, Vector3> templist = item.Value; List <GameObject> tempgos = new List <GameObject>(); Dictionary <int, MatchingItemButton> dicbuts = new Dictionary <int, MatchingItemButton>(); foreach (KeyValuePair <int, Vector3> it in templist) { GameObject g = SpawnChildren(SpawnChild.SecendPoolItem, Pointbuttonitem.transform.parent); g.SetActive(false); int tempgroup = group; int tempindex = it.Key; g.transform.SetAsLastSibling(); g.GetComponentInChildren <Text>().text = groupstr + " " + (tempindex + 1).ToString(); MatchingItemButton Matchingitem = g.GetComponent <MatchingItemButton>(); Matchingitem.Init(tempgroup, tempindex, SetLastMatchingItem); tempgos.Add(g); dicbuts.Add(tempindex, Matchingitem); } listmap.Add(b, tempgos); buttonmap.Add(group, dicbuts); if (group == currentgroup) { ChoisePanel(b); } } }
public void RefreshViewByUserModelData() { Dictionary <int, Dictionary <int, Vector3> > savedmap = PlayerDataCenter.Instance.Currentuserpointmap; foreach (KeyValuePair <int, Dictionary <int, Vector3> > item in savedmap) { foreach (KeyValuePair <int, Vector3> it in item.Value) { MatchingItemButton mib = GetMatchingItem(item.Key, it.Key); if (mib) { mib.HandleEvent(PointControll_E.SaveMatchingpoint); } } } }
public void RefreshViewByUserModelData() { Dictionary <int, Dictionary <int, Vector3> > savedmap = PointHelper.GetInstance().userdataformweb; foreach (KeyValuePair <int, Dictionary <int, Vector3> > item in savedmap) { foreach (KeyValuePair <int, Vector3> it in item.Value) { MatchingItemButton mib = SearchHelper.GetInstance().SerchChoise(buttonmap, item.Key, it.Key); if (mib) { mib.SaveMatchingpoint(); } } } }