예제 #1
0
    public static LatLng LatLongFromUnityVector3D(Vector3 aPosition)
    {
        Vector3  unityCoords = aPosition;
        Vector2d convertPos2D;

        convertPos2D.x = unityCoords.x;
        convertPos2D.y = unityCoords.z;
        //
        //MapAtWorldScale aMap = MapAtWorldScale.FindObjectOfType<MapAtWorldScale>();
        BasicMap aMap = BasicMap.FindObjectOfType <BasicMap>();

        convertPos2D = aMap.CenterMercator + (convertPos2D * aMap.WorldRelativeScale);
        Vector2d Ref2d;

        Ref2d = Mapbox.Unity.Utilities.Conversions.MetersToLatLon(convertPos2D);
        LatLng outputlatLng = new LatLng(Ref2d.x, Ref2d.y);

        return(outputlatLng);
    }
예제 #2
0
    // 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());
        }
    }
예제 #3
0
 void Start()
 {
     MyMap = BasicMap.FindObjectOfType <BasicMap>();
 }