/// <summary> /// ExitButton1 /// </summary> public void ExitButton1Func2() { inputField.enabled = true; dropdown1.enabled = true; dropdown2.ClearOptions(); LinePointText.text = ""; dropdown3.gameObject.SetActive(false); dropdown2.gameObject.SetActive(false); LineCountText.gameObject.SetActive(false); LinePointText.gameObject.SetActive(false); dropdown3.ClearOptions(); NowLineNetCount = 0; NowLineNetNumber = 0; IsSeletingMode = false; IsLineNetCountChange = false; Button3.gameObject.SetActive(true); JudgeText.text = ""; JudgeText.gameObject.SetActive(false); ExitButton1.gameObject.SetActive(false); IsLineNetChange = false; Have_SeletPointList.Clear(); LineNets.Clear(); NowLineNet = null; IsSure = false; }
/// <summary> /// 选择不同线网过程 /// </summary> public void LineNetJudge() { if (IsSeletingMode && IsLineNetCountChange) { LineNets.Clear(); dropdown2.ClearOptions(); dropdown2.gameObject.SetActive(true); LinePointText.gameObject.SetActive(true); SeletLineNet = int.Parse(dropdown3.captionText.text); Judge(); List <string> vs = new List <string>(); for (int i = 1; i <= SeletLineNet; i++) { vs.Add("线网" + i.ToString()); LineNet lineNet = new LineNet() { LineNumber = i }; LineNets.Add(lineNet); } dropdown2.AddOptions(vs); Have_SeletPointList.Clear(); IsLineNetCountChange = false; IsLineNetChange = true; } if (IsSeletingMode) { string str = dropdown2.captionText.text.Replace("线网", ""); if (NowLineNetNumber != int.Parse(str)) { IsLineNetChange = true; } } if (IsSeletingMode && IsLineNetCountChange || IsSeletingMode && IsLineNetChange) { string str = dropdown2.captionText.text.Replace("线网", ""); NowLineNetNumber = int.Parse(str); NowLineNet = LineNets[NowLineNetNumber - 1]; } if (IsSeletingMode && IsLineNetChange) { LinePointText.text = ""; if (NowLineNet.Point.Count != 0) { foreach (var item in NowLineNet.Point) { LinePointText.text += item.GetComponent <ImportantPoint_number>().Number.ToString() + " "; } } IsLineNetChange = false; } if (IsSeletingMode && NowLineNetCount != int.Parse(dropdown3.captionText.text)) { IsLineNetCountChange = true; NowLineNetCount = int.Parse(dropdown3.captionText.text); } if (IsSeletingMode) { try { Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); RaycastHit hit = new RaycastHit(); if (Physics.Raycast(ray, out hit, 50, LayerMask.GetMask("ImportantPoint")) && Input.GetMouseButtonDown(0) && !Have_SeletPointList.Contains(hit.collider.gameObject)) { NowLineNet.Point.Add(hit.collider.gameObject); Have_SeletPointList.Add(hit.collider.gameObject); IsLineNetChange = true; } if (Physics.Raycast(ray, out hit, 50, LayerMask.GetMask("ImportantPoint")) && Input.GetMouseButtonDown(1) && NowLineNet.Point.Contains(hit.collider.gameObject)) { NowLineNet.Point.Remove(hit.collider.gameObject); Have_SeletPointList.Remove(hit.collider.gameObject); IsLineNetChange = true; } } catch { Debug.Log("UI_message+IsSeletingModeIsSeletingMode相机1缺失"); } } }