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