예제 #1
0
    IEnumerator Spread()
    {
        yield return(new WaitUntil(() => size > 0.8f));

        while (true)
        {
            float timeToSpread = HushPuppy.RandomFloat(timeBetweenSpreads);
            yield return(new WaitForSeconds(timeToSpread));

            int offspring = Random.Range(1, this.maxSpreadOffspring + 1);
            for (int i = 0; i < offspring; i++)
            {
                Generate();
            }
        }
    }
예제 #2
0
 public void ResetState()
 {
     this.timeOfDeath = HushPuppy.RandomFloat(this.lifeExpectancyRange);
     this.lifetime    = 0f;
     this.isDead      = false;
 }