コード例 #1
0
    void RouteBox()
    {
        int boxWidth  = 300;
        int boxHeight = 40;
        int boxX      = Screen.width / 2 - (boxWidth / 2);
        int boxY      = (Screen.height - boxHeight) - 52;

        GUI.BeginGroup(new Rect(boxX, boxY, boxWidth, boxHeight));
        GUI.Box(new Rect(00, 00, boxWidth, boxHeight), "");
        if (route.patrol.Count > 0)
        {
            for (int i = 0; i < route.patrol.Count; i++)
            {
                if (GUI.Button(new Rect(0 + (i * 65) + (i * 5), 10, 65, 20), "Route " + (i + 1).ToString()))
                {
                    route.RouteGraphicsClean();
                    route.RouteGraphicsPopulate((i));
                }
            }
        }

        switch (routemode)
        {
        case RouteMode.AddRoute:

            if (GUI.Button(new Rect(0 + (route.patrol.Count * 65) + (route.patrol.Count * 5), 10, 75, 20), "Add Route"))
            {
                //			new route.patrol();

                clicker.Lclick = s_Clicker.LClicker.RouteStartClick;
                clicker.Rclick = s_Clicker.RClicker.WayPointRemoveClick;
                routemode      = RouteMode.CompleteRoute;
            }
            break;

        case RouteMode.CompleteRoute:
            Btn_Name = "Complete Route";
            if (GUI.Button(new Rect(0 + (route.patrol.Count * 65) + (route.patrol.Count * 5), 10, 115, 20), "Complete Route"))
            {
                //route.patrol.add();
                clicker.Lclick = s_Clicker.LClicker.LNoneClick;
                clicker.Rclick = s_Clicker.RClicker.RNoneClick;
                routemode      = RouteMode.AddRoute;
            }
            break;
        }

        if (new Rect(boxX, (Screen.height - (boxY + boxHeight)), boxWidth, boxHeight).Contains(Input.mousePosition))
        {
            clickSecondTaskBar = true;
        }
        else
        {
            clickSecondTaskBar = false;
        }

        GUI.EndGroup();
    }
コード例 #2
0
 void RouteStartMode(Vector3 x)
 {
     if (route.patrol.Count > 0)
     {
         route.RouteGraphicsClean();
     }
     route.patrol.Add(new Patrol(new WayPoint(x, 1, 4)));
     route.patrol[route.patrol.Count - 1].waypoint.Add(new WayPoint(x, 1, 4));
     route.RouteGraphicsPopulate((route.patrol.Count - 1));
     Lclick = LClicker.RouteAddClick;
     //Debug.Log(route.waypoint[route.waypoint.Count-1].Coord.ToString());
     //Debug.Log("waypoint has "+route.waypoint.Count+" Items");
 }