public void SpawnRepeating(SpawnPopulation population, SpawnDistribution distribution) { int targetCount = this.GetTargetCount(population, distribution); int currentCount = this.GetCurrentCount(population, distribution); int num = Mathf.RoundToInt((float)(targetCount - currentCount) * population.GetCurrentSpawnRate()); int numToFill = Random.Range(Mathf.Min(num, this.MinSpawnsPerTick), Mathf.Min(num, this.MaxSpawnsPerTick)); this.Spawn(population, distribution, targetCount, numToFill, numToFill * population.SpawnAttemptsRepeating); }
public void SpawnRepeating(SpawnPopulation population, SpawnDistribution distribution) { int targetCount = this.GetTargetCount(population, distribution); int currentCount = targetCount - this.GetCurrentCount(population, distribution); currentCount = Mathf.RoundToInt((float)currentCount * population.GetCurrentSpawnRate()); currentCount = UnityEngine.Random.Range(Mathf.Min(currentCount, this.MinSpawnsPerTick), Mathf.Min(currentCount, this.MaxSpawnsPerTick)); this.Spawn(population, distribution, targetCount, currentCount, currentCount * population.SpawnAttemptsRepeating); }