网站建设过程,sem是什么岗位,全网加速器,中国十大品牌营销策划公司文章首发见博客#xff1a;https://mwhls.top/4850.html。 无图/格式错误/后续更新请见首发页。 更多更新请到mwhls.top查看 欢迎留言提问或批评建议#xff0c;私信不回。 汇总#xff1a;Unity 记录 现在卡在了跨地图洞穴生成#xff0c;没想到什么好的方法能够像地面一样… 文章首发见博客https://mwhls.top/4850.html。 无图/格式错误/后续更新请见首发页。 更多更新请到mwhls.top查看 欢迎留言提问或批评建议私信不回。 汇总Unity 记录 现在卡在了跨地图洞穴生成没想到什么好的方法能够像地面一样随机连续洞穴块。 摘要带种子的柏林噪声。 FastNoise_C#-2023/9/2
Auburn/FastNoise_CSharp: FastNoise C# VersionFeature: Value Noise 2D, 3DPerlin Noise 2D, 3DSimplex Noise 2D, 3D, 4DCubic Noise 2D, 3DGradient Perturb 2D, 3DMultiple fractal options for all of the aboveCellular (Voronoi) Noise 2D, 3DWhite Noise 2D, 3D, 4DSupports floats or doubles
带种子的柏林噪声-2023/9/1
Unity的柏林噪声设置不了种子而后续我可能会需要通过固定输入来获取地图状态因此改用FastNoise。
实现代码-2023/08/31-2023/9/1
本来还包括一个地图块的类但是我目前的边界点和周围是相关的和随机生成有点冲突考虑到用空间换计算量挺划算所以也没实现计算边界点因此这个类没什么信息量没放。 // Thanks to Auburn and other authers of FastNoise, I copied it in 2023/9/2 from https://github.com/Auburn/FastNoise_CSharppublic class Noise{public int seed;FastNoise _noise_generator;public Noise(int seed-1){if (seed -1) seed System.DateTime.Now.Millisecond;this.seed seed;_noise_generator new(seed);}public float perlin(int x, int y, float scale){_noise_generator.SetNoiseType(FastNoise.NoiseType.Perlin);_noise_generator.SetFrequency(1/scale);float noise_value _noise_generator.GetNoise(x, y);return noise_value;}public float perlin(int x, float scale){_noise_generator.SetNoiseType(FastNoise.NoiseType.Perlin);_noise_generator.SetFrequency(1/scale);float noise_value _noise_generator.GetNoise(x, 0f);return noise_value;}static float perlin(int x, int y, float scale, int seed){FastNoise noise_generator new(seed);noise_generator.SetNoiseType(FastNoise.NoiseType.Perlin);noise_generator.SetFrequency(1/scale);float noise_value noise_generator.GetNoise(x, y);return noise_value;}static float perlin(int x, float scale, int seed){float noise_value perlin(x, 0, scale, seed);return noise_value;}}