void DownloadNormalMap()
 {
     Done++;
     CreateFolders();
     EditorCoroutine.StartCoroutine(DownloadNormalMapCo());
 }
        void OnGUI()
        {
            //GUI.skin = EditorGUIUtility.Load(GetPath(ePATHSPEC.SKINPATH)) as GUISkin;
            GUI.skin = mySkin;
            // OnSceneGUI();
            //Handles.Draw(rect, camera, CameraDrawMode.Textured)
            // OnDrawGizmos();
            ZoomLevel = EditorGUILayout.IntField("Zoom Level", ZoomLevel);

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("-"))
            {
                TileX--;
            }

            TileX = EditorGUILayout.IntField("TileX", TileX);

            if (GUILayout.Button("+"))
            {
                TileX++;
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("-"))
            {
                TileZ--;
            }
            TileZ = EditorGUILayout.IntField("TileZ", TileZ);
            if (GUILayout.Button("+"))
            {
                TileZ++;
            }

            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Set As Start Point") == true)
            {
                SetStartPoint();
            }
            GUILayout.EndHorizontal();

            GUILayout.Label("Creation", EditorStyles.boldLabel);

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Auto Generate 1 Tile") == true)
            {
                EditorCoroutine.StartCoroutine(GenerateAll());
            }
            bExport = EditorGUILayout.Toggle("Export Bundle", bExport);
            GUILayout.EndHorizontal();

            GUILayout.Label("Range", EditorStyles.boldLabel);

            GUILayout.BeginHorizontal();
            RangeSize = EditorGUILayout.IntField("Range", RangeSize);
            if (GUILayout.Button("Generate") == true)
            {
                EditorCoroutine.StartCoroutine(GenerateRange());
            }
            GUILayout.EndHorizontal();
            if (GUILayout.Button("Download Neighbouring Heightmaps") == true)
            {
                DownloadHeightmapNeighbours();
            }
            GUILayout.Label((TileX - RangeSize) + "," + (TileZ - RangeSize) + "-" + (TileZ + RangeSize) + "," + (TileZ + RangeSize), EditorStyles.boldLabel);

            GUILayout.BeginHorizontal();
            bCreateGrass = EditorGUILayout.Toggle("Create Grass", bCreateGrass);
            GUILayout.EndHorizontal();

            GUILayout.Label("Components", EditorStyles.boldLabel);
            GUILayout.Label("Download", EditorStyles.boldLabel);
            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Basemap") == true)
            {
                DownloadBasemap();
            }
            // GUILayout.Box(HeightMap, GUILayout.Width(64), GUILayout.Height(64));
            //EditorGUI.DrawPreviewTexture(new Rect(25, 60, 100, 100), HeightMap);

            if (GUILayout.Button("Heightmap") == true)
            {
                DownloadHeightMap();
            }

            if (GUILayout.Button("NormalMap") == true)
            {
                DownloadNormalMap();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Create Continuity") == true)
            {
                CreateContiuousTiles();
            }

            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Generate Mesh Terrain") == true)
            {
                GenerateMeshTerrain();
            }
            GUILayout.EndHorizontal();

            GUILayout.Label("Generate", EditorStyles.boldLabel);

            if (GUILayout.Button("Get OSM Tile") == true)
            {
                DownloadOSM();
            }

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Roads") == true)
            {
                DownloadRoads();
            }
            if (GUILayout.Button("Water") == true)
            {
                DownloadWater();
            }
            if (GUILayout.Button("Buildings") == true)
            {
                DownloadBuildings();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Road Network") == true)
            {
                GenerateRoadNetwork();
            }
            if (GUILayout.Button("Road Network Test") == true)
            {
                GenerateRoadNetworkTest();
            }
            if (GUILayout.Button("Polygon Test") == true)
            {
                PolygonTest();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Get Geo Info") == true)
            {
                GetGeoInfo();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Fix Terrain Mesh") == true)
            {
                FixMesh();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Generate Prefab") == true)
            {
                GeneratePrefab();
            }
            GUILayout.EndHorizontal();

            GUILayout.BeginHorizontal();
            if (GUILayout.Button("Export Assetbundle") == true)
            {
                ExportAssetBundle();
            }
            GUILayout.EndHorizontal();

            GUILayout.Label("Bundle Export Location");
            ExportLocation = GUILayout.TextField(ExportLocation);

            MajorRoadMaterial   = EditorGUILayout.ObjectField("Major Road Material", MajorRoadMaterial, typeof(Material)) as Material;
            RoadMaterial        = EditorGUILayout.ObjectField("Road Material", RoadMaterial, typeof(Material)) as Material;
            SmallStreetMaterial = EditorGUILayout.ObjectField("Small Road Material", SmallStreetMaterial, typeof(Material)) as Material;
            PathMaterial        = EditorGUILayout.ObjectField("Path Material", PathMaterial, typeof(Material)) as Material;
            RailwayMaterial     = EditorGUILayout.ObjectField("Railway Material", RailwayMaterial, typeof(Material)) as Material;
            WaterMaterial       = EditorGUILayout.ObjectField("Water Material", WaterMaterial, typeof(Material)) as Material;
            BuildingMaterial    = EditorGUILayout.ObjectField("Building Material", BuildingMaterial, typeof(Material)) as Material;
            RoofMaterial        = EditorGUILayout.ObjectField("Roof Material", RoofMaterial, typeof(Material)) as Material;
            ServiceRoadMaterial = EditorGUILayout.ObjectField("Service Road Material", ServiceRoadMaterial, typeof(Material)) as Material;

            if (GUILayout.Button("STOP"))
            {
                Stop = true;
            }

            GUILayout.BeginHorizontal();
            GUILayout.Label("Progress", EditorStyles.boldLabel);
            EditorGUILayout.FloatField(progress);
            Done = EditorGUILayout.IntField(Done);
            GUILayout.EndHorizontal();
        }
 //TODO get wiki info http://api.geonames.org/findNearbyWikipedia?lat=47&lng=9&username=demo
 void GetGeoInfo()
 {
     Done++;
     EditorCoroutine.StartCoroutine(GetGeoInfoCo());
 }
 void DownloadHeightMap()
 {
     HeightmapDone++;
     CreateFolders();
     EditorCoroutine.StartCoroutine(DownloadHeightMapCo());
 }
 void DownloadRoads()
 {
     Done++;
     CreateFolders();
     EditorCoroutine.StartCoroutine(DownloadFeaturesCo("roads", Paths.GetPath(ePATHSPEC.ROADSPATH), GenerateRoads));
 }
 void DownloadWater()
 {
     Done++;
     CreateFolders();
     EditorCoroutine.StartCoroutine(DownloadFeaturesCo("water", Paths.GetPath(ePATHSPEC.WATERPATH), GenerateWater));
 }
 void DownloadBuildings()
 {
     Done++;
     CreateFolders();
     EditorCoroutine.StartCoroutine(DownloadFeaturesCo("buildings", Paths.GetPath(ePATHSPEC.BUILDINGSPATH), GenerateBuildings));
 }
 void DownloadOSM()
 {
     Done++;
     EditorCoroutine.StartCoroutine(DownloadOSMCo());
 }
Exemple #9
0
        private IEnumerator StartJoinableCoroutine(int index, IEnumerator coroutine)
        {
            yield return(EditorCoroutine.StartCoroutine(coroutine));

            _subTasks[index] = true;
        }
Exemple #10
0
 public EditorCoroutine WaitForAll()
 {
     return(EditorCoroutine.StartCoroutine(WaitForAllSubtasks()));
 }
Exemple #11
0
 public void StartSubtask(IEnumerator routine)
 {
     _subTasks.Add(false);
     EditorCoroutine.StartCoroutine(StartJoinableCoroutine(_subTasks.Count - 1, routine));
 }