예제 #1
0
    private void StartNextStage()
    {
        switch (_currentStage)
        {
        case Stage.WaitingToStart:
            _currentStage   = Stage.Stage_1;
            maxEnemiesAlive = _maxEnemiesAlineStage1;
            break;

        case Stage.Stage_1:
            _currentStage   = Stage.Stage_2;
            maxEnemiesAlive = _maxEnemiesAlineStage2;
            break;

        case Stage.Stage_2:
            _currentStage   = Stage.Stage_3;
            maxEnemiesAlive = _maxEnemiesAlineStage3;
            break;

        case Stage.Stage_3:
            _currentStage   = Stage.Stage_4;
            maxEnemiesAlive = _maxEnemiesAlineStage4;
            break;
        }
        OnStageChanged?.Invoke(this, _currentStage);
    }
예제 #2
0
    private bool ToNextStage()
    {
        if (currentStage.LastingDays < 1)
        {
            return(false);
        }

        stageTime -= TimeManager.Instance.ScaleDayToReal * currentStage.LastingDays;
        stageTime  = stageTime < 0 ? 0 : stageTime;
        stageDays  = Mathf.CeilToInt(stageTime / TimeManager.Instance.ScaleDayToReal);

        currentStage = nextStage;
        OnStageChanged?.Invoke(currentStage);
        if (!currentStage)
        {
            parent.RemoveCrop(this);
            return(false);
        }
        currentStageIndex = Info.Stages.IndexOf(currentStage);

        harvestTimes++;
        HandlingNextStage();

        return(true);
    }
예제 #3
0
 public void CallOnStageChanged(EventData ob = null) => OnStageChanged?.Invoke(ob);