// Update is called once per frame void Update() { if (!s.agent.isMoving && StatsUtils.SamplePoisson(jumpsPerSecond * Time.deltaTime) > 0) { animator.SetTrigger("DoJump"); } }
// Update is called once per frame void Update() { float expectedZombiesInTimePeriod = expectedZombiesPerSecond * Time.deltaTime; int numToSpawn = StatsUtils.SamplePoisson(expectedZombiesInTimePeriod); for (int i = 0; i < numToSpawn; i++) { DoSpawn(); } }