// Start is called before the first frame update void Awake() { SeedOffset = Random.Range(0.0f, 5000.0f); MainPerlin = new CustomPerlin(SeedOffset, WorldMultiplier); SolidThresholdPerlin = new CustomPerlin(SeedOffset, SolidThresholdMultiplier); ExplosivePerlin = new CustomPerlin(SeedOffset, ExplosiveSpreadFactor, true); _spawnPoolFeatures = new Dictionary <LevelFeatureSpawnPool, List <LevelFeature> >(); //build level feature list if (LevelFeaturePrefabs != null) { foreach (LevelFeature levelFeature in LevelFeaturePrefabs) { if (!_spawnPoolFeatures.ContainsKey(levelFeature.SpawnPool)) { _spawnPoolFeatures[levelFeature.SpawnPool] = new List <LevelFeature>(); } _spawnPoolFeatures[levelFeature.SpawnPool].Add(levelFeature); } } }
public void GenerateTexture(CustomPerlin toUse) { CurPerlin = toUse; NoiseTransform.localScale = new Vector3(ChunkSize, ChunkSize, 1); NoiseRenderer.material.mainTexture = toUse.OutputToTexture(ChunkSize, ChunkSize, ChunkStart.x, ChunkStart.y); }