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); }
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); }
public void CallOnStageChanged(EventData ob = null) => OnStageChanged?.Invoke(ob);