Ejemplo n.º 1
0
    private void Awake()
    {
        ChunksToLoad2 = new PriorityQueue <LoadedChunk2>();

        ChunkBuffer = new List <LoadedChunk2>();

        ChunkToLoadLock       = new Object();
        ChunksToLoad          = new List <ChunkData>(60);
        ChunksToLoadPositions = new List <Vec2i>(60);

        PreLoadedChunkLock = new Object();
        PreLoadedChunks    = new List <PreLoadedChunk>(60);

        ObjectsToLoadLock = new Object();
        ObjectsToLoad     = new List <WorldObjectData>();

        CurrentVerticies = new List <Vector3>(World.ChunkSize * World.ChunkSize * 6);
        CurrentTriangles = new List <int>(World.ChunkSize * World.ChunkSize * 6);
        CurrentUVs       = new List <Vector2>(World.ChunkSize * World.ChunkSize * 6);
        CurrentColours   = new List <Color>(World.ChunkSize * World.ChunkSize * 6);

        ChunkRegionManager = GetComponent <ChunkRegionManager>();

        MarchingCubes = new MarchingCubes(-0.5f);
        ForceLoad     = false;
    }
Ejemplo n.º 2
0
    void Awake()
    {
        Instance          = this;
        ToGetLoadedChunks = new Dictionary <ChunkData, int>();
        LoadedChunks      = new Dictionary <Vec2i, LoadedChunk2>();
        LoadedRegions     = new ChunkRegion[World.RegionCount, World.RegionCount];


        ToUnloadChunks = new List <Vec2i>();

        SubworldChunks = new Dictionary <Vec2i, LoadedChunk2>();
        ThreadSafe     = new Object();

        ChunkLoader = GetComponent <ChunkLoader>();
    }