Пример #1
0
 // Update is called once per frame
 void Update()
 {
     if (!s.agent.isMoving && StatsUtils.SamplePoisson(jumpsPerSecond * Time.deltaTime) > 0)
     {
         animator.SetTrigger("DoJump");
     }
 }
Пример #2
0
    // 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();
        }
    }