Beispiel #1
0
    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();
            }
        }
    }
Beispiel #2
0
    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;
        }
    }
Beispiel #3
0
    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);
    }
Beispiel #4
0
    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;
        }
    }
Beispiel #5
0
 public void SetSeason(GameController.Seasons season)
 {
     this.season = season;
 }