コード例 #1
0
    public ChunkOperator(ChunkManager chunks, string saveName, string worldName, int seed)
    {
        _terrainGenerator = new ChunkTerrainGenerator();
        _terrainGenerator.Init();

        _chunks = chunks;

        _seed = seed;

        Air = BlockManager.Inst.GetBlockOrDefault("Base/Block/Air");

        int threadCount = 4;//Mathf.Max(Environment.ProcessorCount / 2 - 1, 2);

        Console.WriteLine($"Worker thread count: {threadCount}");
        _threadHolder.Release(threadCount);
    }
コード例 #2
0
    public ChunkOperator(ChunkManager chunks, string saveName, string worldName, int seed)
    {
        _terrainGenerator = new ChunkTerrainGenerator();
        _terrainGenerator.Init();

        _chunks      = chunks;
        _toWorldSave = Path.Combine(_toSaveFolder, saveName, worldName);

        _seed = seed;

        Air = BlockManager.Inst.GetBlockOrDefault("Base/Block/Air");

        int threadCount = 6;//Mathf.Max(Environment.ProcessorCount / 2 - 1, 2);

        Debug.Log($"Worker thread count: {threadCount}");
        _threadHolder.Release(threadCount);
    }