Ejemplo n.º 1
0
 private void DrawRectangle(singleBox e, Color color, float width = 0.03f)
 {
     e.ob1 = DrawLine(Base, new Vector3(e.start.x, e.start.y), new Vector3(e.start.x, e.end.y), color, width);
     e.ob2 = DrawLine(Base, new Vector3(e.start.x, e.end.y), new Vector3(e.end.x, e.end.y), color, width);
     e.ob3 = DrawLine(Base, new Vector3(e.start.x, e.start.y), new Vector3(e.end.x, e.start.y), color, width);
     e.ob4 = DrawLine(Base, new Vector3(e.end.x, e.start.y), new Vector3(e.end.x, e.end.y), color, width);
 }
Ejemplo n.º 2
0
 private void RemoveRect(singleBox box)
 {
     Destroy(box.ob1);
     Destroy(box.ob2);
     Destroy(box.ob3);
     Destroy(box.ob4);
 }
Ejemplo n.º 3
0
 private void ChooseStartBox(singleBox box)
 {
     DrawMap();
     point[0] = new singleBox(box);
     Debug.Log("start point: " + point[0].start);
     fillIcon(box, icon_start);
 }
Ejemplo n.º 4
0
    private void ChooseEndBox(singleBox box)
    {
        point[1] = new singleBox(box);
        Debug.Log("end point: " + point[1].start);
        fillIcon(box, icon_end);
        var x = StartCoroutine(FindWays());

        isfind = true;
    }
Ejemplo n.º 5
0
 private void ChooseBox(singleBox box)
 {
     if (point[0] == null || point[0] != null && point[1] != null || point[0].Equals(point[1]))
     {
         point[0] = null;
         point[1] = null;
         ChooseStartBox(box);
     }
     else
     {
         ChooseEndBox(box);
     }
 }
Ejemplo n.º 6
0
 private void DrawMap()
 {
     ClearChild(Base);
     for (int i = 0; i < max_w; i++)
     {
         for (int j = max_h; j > 0; j--)
         {
             Vector2 start = new Vector2(firstPosition.x + size.x * i, firstPosition.y - size.y * (max_h - j));
             Vector2 end   = new Vector2(firstPosition.x + size.x * i + size.x, firstPosition.y - size.y * (max_h - j) - size.y);
             var     box   = new singleBox(start, end);
             listBox.Add(box);
             DrawRectangle(box, color_def);
         }
     }
 }
Ejemplo n.º 7
0
 public singleBox(singleBox box)
 {
     this.start = box.start;
     this.end   = box.end;
 }
Ejemplo n.º 8
0
 private void fillIcon(singleBox e, GameObject icon)
 {
     Instantiate(icon, Base).transform.position = new Vector3(e.start.x + size.x / 2, e.start.y - size.y / 2);
 }