Ejemplo n.º 1
0
        public void PutBlock(Ray ray, float range)
        {
            if (Physics.Raycast(ray, out RaycastHit hit, range))
            {
                Vector3 position = hit.point + 0.5f * hit.normal;

                if (dimension.Blocks[position].Traits.IsReplaceable())
                {
                    var block = new GrassBlock();
                    dimension.Blocks[position] = block;
                    terrainRenderer.Redraw(position);
                }
            }
        }