Closed Shadowblitz16 closed 1 month ago
How do I initialize something?
using System.Runtime.CompilerServices; using Arch.System; using VoxelTest.Games.VoxelGame.Components; namespace VoxelTest.Games.VoxelGame.Systems; public partial class ChunkSystem : BaseSystem<World, float> { private static CubeMeshBuilder _meshBuilder = new(); public ChunkSystem(World world) : base(world) { } [Query] [MethodImpl(MethodImplOptions.AggressiveInlining)] public void RenderChunk([Data] ref Grid<ushort> blocks, ref PositionI position) { } public static void Build(ref Grid<ushort> blocks, PositionI chunkPosition, PositionI blockPosition) { for (var z = 0; z < blocks.Size; z++) for (var y = 0; y < blocks.Size; y++) for (var x = 0; x < blocks.Size; x++) { if (chunkPosition.Y + y > 0) blocks.Blocks[GetIndex(ref blocks, blockPosition)] = 1; else blocks.Blocks[GetIndex(ref blocks, blockPosition)] = 0; } }
Sorry I posted this in the wrong section
How do I initialize something?