Пример #1
0
    private void Grow()
    {
        growth++;
        SetStage();

        if (stage == numberOfStages - 1)
        {
            grown = true;
            TickSystem.Unsubscribe(Grow);
        }
    }
Пример #2
0
    void Plant()
    {
        if (finished)
        {
            return;
        }

        plantTicks++;
        if (plantTicks >= plantNeededTicks)
        {
            TickSystem.Unsubscribe(Plant);
            FinishPlanting();
        }
    }
    void Build()
    {
        if (finished)
        {
            return;
        }

        buildTicks++;
        buildable.BuildTick(buildTicks);
        if (buildTicks >= buildable.neededTicks)
        {
            TickSystem.Unsubscribe(Build);
            FinishBuilding();
        }
    }
Пример #4
0
    void Chop()
    {
        if (finished)
        {
            return;
        }

        ticks++;
        UpdateSprite();
        if (ticks >= neededTicks)
        {
            TickSystem.Unsubscribe(Chop);
            Finish();
        }
    }