コード例 #1
0
    IEnumerator babyTime(BoidStats newBorn, float size)
    {
        newBorn.size /= 2;
        newBorn.ApplyStatsVisuals();
        yield return(new WaitForSeconds(3.0f));

        newBorn.size = size;
        newBorn.ApplyStatsVisuals();
        yield return(null);
    }
コード例 #2
0
    IEnumerator babyTime(BoidStats newBorn, float size)
    {
        Timer timer = new Timer(1.0f);

        while (!timer.Trigger())
        {
            newBorn.size = size / Utils.Map(timer.timeLeft, 0.0f, 1.0f, 1.0f, 5.0f);
            newBorn.ApplyStatsVisuals();
            yield return(new WaitForSeconds(0.1f));
        }
        newBorn.size = size;
        newBorn.ApplyStatsVisuals();
        yield return(null);
    }
コード例 #3
0
    // Update is called once per frame
    void Update()
    {
        bs.heatlh += healthUp ? change1 : -change1;
        if (bs.heatlh >= 10.0f || bs.heatlh <= 0.0f) {
            healthUp = !healthUp;
        }

        bs.size += sizeUp ? change2 : -change2;
        if (bs.size >= 10.0f || bs.size <= 0.0f) {
            sizeUp = !sizeUp;
        }

        bs.wealth += wealthUp ? change3 : -change3;
        if (bs.wealth >= 10.0f || bs.wealth <= 0.0f) {
            wealthUp = !wealthUp;
        }

        bs.ApplyStatsVisuals ();
        bs.removeHat ();
        bs.hatSelect ();
    }