private void Init(World world, Vector3Int pos, IChunkStateManager stateManager) { this.world = world; this.pos = pos; this.stateManager = stateManager; const int size = Env.ChunkSize; WorldBounds = new Bounds( new Vector3(pos.x + size / 2, pos.y + size / 2, pos.z + size / 2), new Vector3(size, size, size) ); Reset(); blocks.Init(); stateManager.Init(); }
private void Init(World world, Vector3Int pos, IChunkStateManager stateManager) { this.world = world; this.pos = pos; this.stateManager = stateManager; logic = world.config.randomUpdateFrequency > 0.0f ? new ChunkLogic(this) : null; WorldBounds = new Bounds( new Vector3(pos.x + Env.ChunkSize / 2, pos.y + Env.ChunkSize / 2, pos.z + Env.ChunkSize / 2), new Vector3(Env.ChunkSize, Env.ChunkSize, Env.ChunkSize) ); Reset(); blocks.Init(); stateManager.Init(); }
public void Init(Map map, int cx, int cy, int cz, IChunkStateManager stateManager) { Map = map; Pos = new Vector3Int(cx, cy, cz); m_lod = 0; StateManager = (ChunkStateManagerClient)stateManager; int sizeX = EngineSettings.ChunkConfig.Size << map.VoxelLogScaleX; int sizeY = EngineSettings.ChunkConfig.Size << map.VoxelLogScaleY; int sizeZ = EngineSettings.ChunkConfig.Size << map.VoxelLogScaleZ; WorldBounds = new Bounds( new Vector3(sizeX * (cx + 0.5f), sizeY * (cy + 0.5f), sizeZ * (cz + 0.5f)), new Vector3(sizeX, sizeY, sizeZ) ); Reset(); StateManager.Init(); }