public void UpdateRouteUIInfo() { if (allUIRoutes != null) { selectedRoute = allUIRoutes[routeIndex]; if (selectedRoute != null) { routeDataLabel.text = "Rte: [" + (routeIndex + 1) + "/" + allUIRoutes.Count + "]"; } } }
public void UpdateRouteUIInfo() { if (allUIRoutes != null) { selectedRoute = allUIRoutes[routeIndex]; if (selectedRoute != null) { //This was previous routeUIinfo //activeRouteLabel.text = selectedRoute.mRouteName + "[" + (routeIndex + 1) + "/" + allFactionRoutes.Count + "]"; activeRouteLabel.text = "Rte: [" + (routeIndex + 1) + "/" + allUIRoutes.Count + "]"; } } }
// Use this for initialization void Start() { allLabels = new List <Text>(); actionPoint = 0; getLabels(); allUIRoutes = MasterBlackBoard.allGameRoutes; if (allUIRoutes != null) { selectedRoute = allUIRoutes[routeIndex]; routeListCount = allUIRoutes.Count; } UpdateRouteUIInfo(); UpdateWayPointUIInfo(); UpdateTaskUIInfo(); }
void Start() { factionRouteList = new List <AnvilRoute>(); AnvilWayPoint waypointA0 = new AnvilWayPoint(36.58386, -121.83619, 200, "KM01"); AnvilWayPoint waypointA1 = new AnvilWayPoint(36.58951, -121.85216, 157, "KM02"); AnvilWayPoint waypointA2 = new AnvilWayPoint(36.58951, -121.85216, 157, "KM03"); AnvilWayPoint waypointB0 = new AnvilWayPoint(36.58951, -121.85216, 157, "KM04"); AnvilWayPoint waypointB1 = new AnvilWayPoint(36.58951, -121.85216, 157, "KM05"); AnvilWayPoint waypointB2 = new AnvilWayPoint(36.58951, -121.85216, 157, "KM06"); List <AnvilWayPoint> routeAList = new List <AnvilWayPoint> { waypointA0, waypointA1, waypointA2 }; List <AnvilWayPoint> routeBList = new List <AnvilWayPoint> { waypointB0, waypointB1, waypointB2 }; List <AnvilWayPoint> routeCList = new List <AnvilWayPoint> { waypointB2, waypointB1, waypointA1 }; List <AnvilWayPoint> wayPointList = new List <AnvilWayPoint>(); wayPointList.Add(waypointA0); wayPointList.Add(waypointA1); wayPointList.Add(waypointA2); wayPointList.Add(waypointB0); wayPointList.Add(waypointB1); wayPointList.Add(waypointB2); AnvilRoute routeA = new AnvilRoute("routeA", routeAList); AnvilRoute routeB = new AnvilRoute("routeB", routeBList); AnvilRoute routeC = new AnvilRoute("routeC", routeCList); AnvilRoute allRoutes = new AnvilRoute("allPoints", wayPointList);//this is a workaround to show all waypoints from all routes. allWayPointsList = wayPointList; factionRouteList = new List <AnvilRoute>(); factionRouteList.Add(allRoutes); factionRouteList.Add(routeA); factionRouteList.Add(routeB); factionRouteList.Add(routeC); RefreshFaction(); }
// Use this for initialization void Start() { //faction hard coded to faction 1 for now // string factionName = "Faction1"; MyMap = BasicMap.FindObjectOfType <BasicMap>(); //reset UI if (allUIRoutes == null) { activeWayPointLabel.text = "no pts loaded"; activeRouteLabel.text = "no pts loaded"; } // faction = GameObject.Find(factionName); allUIRoutes = MasterBlackBoard.allGameRoutes; allFactionAgents = MasterBlackBoard.allGameAgents; UpdateAgentUIInfo(); UpdateRouteUIInfo(); UpdateWayPointUIInfo(); UpdateTaskUIInfo(); if (allUIRoutes != null) { selectedRoute = allUIRoutes[routeIndex]; routeListCount = allUIRoutes.Count; } agentCount = allFactionAgents.Count; //blackBoard.GetComponent<BlackBoardScript>().ReadWayPointFile(); foreach (AnvilWayPoint waypoint in allUIRoutes[routeIndex].routeWayPoints) { Debug.Log("SELECTED " + waypoint.ToSaveString()); } }
static public void ReadWayPointsFromFile() { Debug.Log("Reading Waypoints"); allGameWayPoints = new List <AnvilWayPoint>(); string fileName = "Waypoints"; string path = "Assets/Resources/Saves/" + fileName + ".txt"; StreamReader reader = new StreamReader(path); string readString = reader.ReadLine(); // Debug.Log("trying saving to: " + path); while (readString != null) { char[] delimiter = { ',' }; string[] fields = readString.Split(delimiter); // Debug.Log ("Fields 0: " + fields[0]); //Debug.Log ("Fields 1: " + fields[1]); //Debug.Log ("Fields 2: " + fields[2]); allGameWayPoints.Add(new AnvilWayPoint(Convert.ToDouble(fields[0]), Convert.ToDouble(fields[1]), Convert.ToDouble(fields[2]), fields[3])); readString = reader.ReadLine(); } AnvilRoute loadedRoute = new AnvilRoute(fileName, allGameWayPoints); allGameRoutes.Add(loadedRoute); // GameObject.Find("UIController").GetComponent<UserControlScript>().UpdateRouteUIInfo(); // controlScript.GetComponent<UIControlScript> ().nextRoute(); }
public void setRoute(AnvilRoute route) { this.agentRoute = route; }