private void Button_Click_2(object sender, RoutedEventArgs e) { Graphe graph = new Graphe(matrixAj); List <int> l = new List <int>(); l = graph.connexPoint(matrixAj); foreach (int i in l) { //MessageBox.Show(i.ToString()); draw(i); } }
int Update() { if (p_Toggle.isOn) { m_Toggle.isOn = false; if (Input.GetMouseButtonDown(0) && !desiinationSelected && destinationObject == null) { //Destroy(textToDelete); ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out rayHit)) { if (rayHit.collider.gameObject.name.Contains("R")) { originObject = rayHit.collider.gameObject; origin = int.Parse(originObject.name.Substring(1, 1)); Debug.Log("origin added"); rayHit.collider.gameObject.transform.GetChild(0).GetComponent <StickName>().nameLable.GetComponent <Outline>().enabled = true; desiinationSelected = true; return(0); } } } if (Input.GetMouseButtonDown(0) && desiinationSelected && nbrclicks <= 1) { ray = Camera.main.ScreenPointToRay(Input.mousePosition); if (Physics.Raycast(ray, out rayHit)) { if (originObject != rayHit.collider.gameObject && rayHit.collider.gameObject.name.Contains("R")) { rayHit.collider.gameObject.transform.GetChild(0).GetComponent <StickName>().nameLable.GetComponent <Outline>().enabled = true; destinationObject = rayHit.collider.gameObject; Debug.Log("destination added"); nbrclicks++; startButt.onClick.AddListener(delegate { Graphe g = new Graphe(); g.PathResult(origin, int.Parse(destinationObject.name.Substring(1, 1))); }); /*Graphe g = new Graphe(); * g.PathResult(origin, int.Parse(destinationObject.name.Substring(1, 1)));*/ } else { return(0); } } } } return(0); }
public void CreerPoint(string nom) { Graphe.Add(new Parti02.Point(nom)); }