private void GrowingTimeLoseSecond() { remainLifeSeconds = Math.Max(0, remainLifeSeconds - 1); OnGrowingRateChange?.Invoke(GrowRate); if (remainLifeSeconds <= 0) { state = TOMATO_PLANT_STATE.Reaped; fruit = new TomatoFruit(this); OnReapFruit?.Invoke(fruit); } }
private void CurPlant_OnReapFruit(TomatoFruit fruit) { if (curPlant == null) { throw new Exception("CurPlant_OnReapFruit fail, curPlant is nil."); } RefreshShowRestTime(); SwitchPauseView(); QueryStartRest(); }
public TomatoFruit AddTodayGoal(TomatoFruit fruit) { fruits.Add(fruit); return(fruit); }