Example #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>();
 }
Example #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);
 }
Example #5
0
    public static void AddChunkToMap(Vector2 chunkCoord)
    {
        Vector2 sampleCenter = chunkCoord * _singleton._meshSettings.MeshWorldSize / _singleton._meshSettings.MeshScale;

        ThreadedDataRequester.RequestData(() => RequestTextureChunkData(chunkCoord, sampleCenter), ReceivedTextureChunkData);
    }
Example #6
0
 public void RequestMesh(HeightMap heightMap, MeshSettings meshSettings)
 {
     hasRequestedMesh = true;
     ThreadedDataRequester.RequestData(() => Mesh_Generator.GenerateTerrainMesh(heightMap.values, meshSettings, lod), OnMeshDataReceived);
 }
Example #7
0
 public void load()
 {
     ThreadedDataRequester.requestData(() => worldGenerator.queryBiom((int)coord.x, (int)coord.y, 16), onBiomDataReceived);
 }
Example #8
0
 public void RequestMesh(float[,] values, MeshSettings meshSettings)
 {
     hasRequestedMesh = true;
     ThreadedDataRequester.RequestData(() => MeshGenerator.GenerateTerrainMesh(values, meshSettings, lod), OnMeshDataReceived);
 }
Example #9
0
 public void Load()
 {
     ThreadedDataRequester.RequestData(() => HeightMapGenerator.GenerateHeightMap(meshSettings.verticesPerLineCount, meshSettings.verticesPerLineCount, heightMapSettings, sampleCentre), OnHeightMapGenerated);
 }
Example #10
0
 public void Load()
 {
     ThreadedDataRequester.RequestData(GenerateHeightMap, OnHeightMapReceived);
 }
 void Awake()
 {
     instance = FindObjectOfType <ThreadedDataRequester> ();
     ThreadPool.SetMaxThreads(maxThreads, maxThreads);
 }
Example #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);
 }
Example #13
0
 //requesting the meshData
 public void RequestMesh(HeightMap heightMap, MeshSettings meshSettings)
 {
     meshHasBeenRequested = true;
     ThreadedDataRequester.RequestData(() => MeshGenerator.GenerateTerrainMesh(heightMap.values, meshSettings, lod), OnMeshDataRecieved);
 }
Example #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);
 }
Example #16
0
 public void Load()
 {
     ThreadedDataRequester.RequestData(() => HeightMapGenerator.GenerateHeightMap(meshSettings.numVerticesPerLine, meshSettings.numVerticesPerLine, heightMapSettings, edgesData, sampleCenter), OnHeightMapRecieved);
 }
 void Awake()
 {
     instance = FindObjectOfType <ThreadedDataRequester> ();
 }
Example #18
0
 private void Awake()
 {
     // on awake, sets the instance to be the object of threaded data requester
     instance = FindObjectOfType <ThreadedDataRequester>();
 }
Example #19
0
 public void Load()
 {
     ThreadedDataRequester.RequestData(() => HeightMapGenerator.GenerateHeightMap(meshSettings.NumVertsPerLine, meshSettings.NumVertsPerLine, heightMapSettings, sampleCentre), OnHeightMapReceived);
 }
Example #20
0
 private void Awake()
 {
     instance = FindObjectOfType <ThreadedDataRequester>(); //Ă„NDRA SEN
 }