Exemple #1
0
        public VoxelModel(Vector3Int size, Color32[] palette)
        {
            var voxelsCount = size.x * size.y * size.z;

            Size    = size;
            Palette = palette;
            Voxels  = new VoxelEntity[voxelsCount];
        }
Exemple #2
0
        public void SpawnSingle(Vector3 worldPos, VoxelEntity voxel, float voxelSize, Vector3 velocity)
        {
            var emitterColor = new Color32(); // voxel.ColorIndex;

            var emitter = new ParticleSystem.EmitParams
            {
                position      = worldPos,
                velocity      = velocity,
                startSize     = voxelSize,
                startLifetime = ParticleLifetime,
                startColor    = emitterColor,
            };

            _system.Emit(emitter, 1);
        }
Exemple #3
0
 public void SetVoxel(int index, VoxelEntity voxelEntity)
 {
     Voxels[index] = voxelEntity;
 }
Exemple #4
0
        public void SetVoxel(Vector3Int position, VoxelEntity voxelEntity)
        {
            var index = VoxelUtility.GetVoxelIndex(position, Size);

            Voxels[index] = voxelEntity;
        }
Exemple #5
0
        public void SetVoxel(int x, int y, int z, VoxelEntity voxelEntity)
        {
            var index = VoxelUtility.GetVoxelIndex(x, y, z, Size);

            Voxels[index] = voxelEntity;
        }