void Update() { if (this.elapsedFrames > this.gameFrames) { return; } this.elapsedFrames++; if (this.elapsedFrames == this.gameFrames) { this.Finish(); return; } GameController.Seasons currentSeason = this.GetCurrentSeason(); if (this.lastSeason != currentSeason) { this.OnSeasonChanged(currentSeason); this.lastSeason = currentSeason; } if ((this.elapsedFrames % this.leafProduceFrames) == 0) { if (Random.Range(0.0f, 1.0f) > (float)this.enabledLeafs / (float)this.maxLeafs) { this.AddLeaf(); } } }
public void SetSeason(GameController.Seasons season) { switch (season) { case GameController.Seasons.Spring: this.sublimateColor = Leaf.springColor; break; case GameController.Seasons.Summer: this.sublimateColor = Leaf.summerColor; break; case GameController.Seasons.Autumn: this.sublimateColor = Leaf.autumnColor; break; default: this.sublimateColor = Leaf.springColor; break; } }
public void OnSeasonChanged(GameController.Seasons season) { BoidsConfig config = this.GetComponent <BoidsConfig>(); GameObject container = config.GetBoidsContainer(); Leaf[] leafs = container.GetComponentsInChildren <Leaf>(); for (int i = 0; i < leafs.Length; i++) { leafs[i].SetSeason(season); } this.player.SetSeason(season); }
public void SetSeason(GameController.Seasons season) { this.currentGraduateFrames = 0; this.lastColor = this.currentColor; switch (season) { case GameController.Seasons.Spring: this.currentColor = Leaf.springColor; break; case GameController.Seasons.Summer: this.currentColor = Leaf.summerColor; break; case GameController.Seasons.Autumn: this.currentColor = Leaf.autumnColor; break; default: this.currentColor = Leaf.springColor; break; } }
public void SetSeason(GameController.Seasons season) { this.season = season; }