Beispiel #1
0
 public void Load()
 {
     // () creates a new lambda with no parameters that returns what is on the right of the =>
     ThreadedDataRequester.RequestData(() => HeightMapGenerator.GenerateHeightMap(meshSettings.numVertsPerLine, meshSettings.numVertsPerLine, heightMapSettings, meshSettings, sampleCenter), OnHeightMapReceived);
 }
 public ThreadedDataRequester()
 {
     _instance       = this;
     _runningThreads = new List <Thread>();
 }
Beispiel #3
0
 public void RequestMesh(HeightMap heightMap, MeshSettings meshSettings)
 {
     hasRequestedMesh = true;
     //mapGenerator.RequestMeshData(mapData, levelOfDetail, OnMeshDataReceived);
     ThreadedDataRequester.RequestData(() => MeshGenerator.GenerateTerrainMesh(heightMap.values, meshSettings, levelOfDetail), OnMeshDataReceived);
 }
 protected override void OnHeightMapReceived(object heightMapObject)
 {
     heightMapData = (float[, ])heightMapObject;
     ThreadedDataRequester.RequestData(() => CreateHeightLevelMap(heightMapData), OnHeightLevelMapDataReceived);
 }
Beispiel #5
0
    public static void AddChunkToMap(Vector2 chunkCoord)
    {
        Vector2 sampleCenter = chunkCoord * _singleton._meshSettings.MeshWorldSize / _singleton._meshSettings.MeshScale;

        ThreadedDataRequester.RequestData(() => RequestTextureChunkData(chunkCoord, sampleCenter), ReceivedTextureChunkData);
    }
Beispiel #6
0
 public void RequestMesh(HeightMap heightMap, MeshSettings meshSettings)
 {
     hasRequestedMesh = true;
     ThreadedDataRequester.RequestData(() => Mesh_Generator.GenerateTerrainMesh(heightMap.values, meshSettings, lod), OnMeshDataReceived);
 }
Beispiel #7
0
 public void load()
 {
     ThreadedDataRequester.requestData(() => worldGenerator.queryBiom((int)coord.x, (int)coord.y, 16), onBiomDataReceived);
 }
Beispiel #8
0
 public void RequestMesh(float[,] values, MeshSettings meshSettings)
 {
     hasRequestedMesh = true;
     ThreadedDataRequester.RequestData(() => MeshGenerator.GenerateTerrainMesh(values, meshSettings, lod), OnMeshDataReceived);
 }
Beispiel #9
0
 public void Load()
 {
     ThreadedDataRequester.RequestData(() => HeightMapGenerator.GenerateHeightMap(meshSettings.verticesPerLineCount, meshSettings.verticesPerLineCount, heightMapSettings, sampleCentre), OnHeightMapGenerated);
 }
Beispiel #10
0
 public void Load()
 {
     ThreadedDataRequester.RequestData(GenerateHeightMap, OnHeightMapReceived);
 }
 void Awake()
 {
     instance = FindObjectOfType <ThreadedDataRequester> ();
     ThreadPool.SetMaxThreads(maxThreads, maxThreads);
 }
Beispiel #12
0
 //we only want this to happen after the OnTerrainChunkVisibilityChanged method has been subscribed to the onVisibilityChanged event in order to keep the terrain chunk from changing visibility without being added/removed from the terrainchunksvisible list
 public void Load()
 {
     //gets the mapData
     ThreadedDataRequester.RequestData(() => HeightMapGenerator.GenerateHeightMap(meshSettings.numVertsPerLine, meshSettings.numVertsPerLine, heightMapSettings, sampleCenter), OnHeightMapRecieved);
 }
Beispiel #13
0
 //requesting the meshData
 public void RequestMesh(HeightMap heightMap, MeshSettings meshSettings)
 {
     meshHasBeenRequested = true;
     ThreadedDataRequester.RequestData(() => MeshGenerator.GenerateTerrainMesh(heightMap.values, meshSettings, lod), OnMeshDataRecieved);
 }
Beispiel #14
0
 void onBiomDataReceived(object biomeDataObject)
 {
     biomeData             = biomeDataObject as BiomeData;
     meshRenderer.material = worldGenerator.getMaterialForBiome(biomeData);
     ThreadedDataRequester.requestData(() => HeightMapGenerator.generateHeightmap(meshSettings.numVerticesPerLine, meshSettings.numVerticesPerLine, heightMapSettings, sampleCenter), onHeightMapReceived);
 }
 /// <summary>
 /// Generates a height map on a separate thread.
 /// </summary>
 public void Load()
 {
     // passes the function into the thread using the lambda method
     ThreadedDataRequester.RequestData(() => HeightMapGenerator.GenerateHeightMap(m_meshSettings.NumVertsPerLine, m_meshSettings.NumVertsPerLine, m_heightMapSettings, m_sampleCenter), OnHeightMapReceived);
 }
Beispiel #16
0
 public void Load()
 {
     ThreadedDataRequester.RequestData(() => HeightMapGenerator.GenerateHeightMap(meshSettings.numVerticesPerLine, meshSettings.numVerticesPerLine, heightMapSettings, edgesData, sampleCenter), OnHeightMapRecieved);
 }
 void Awake()
 {
     instance = FindObjectOfType <ThreadedDataRequester> ();
 }
Beispiel #18
0
 private void Awake()
 {
     // on awake, sets the instance to be the object of threaded data requester
     instance = FindObjectOfType <ThreadedDataRequester>();
 }
Beispiel #19
0
 public void Load()
 {
     ThreadedDataRequester.RequestData(() => HeightMapGenerator.GenerateHeightMap(meshSettings.NumVertsPerLine, meshSettings.NumVertsPerLine, heightMapSettings, sampleCentre), OnHeightMapReceived);
 }
Beispiel #20
0
 private void Awake()
 {
     instance = FindObjectOfType <ThreadedDataRequester>(); //ÄNDRA SEN
 }