public void SpendTime(float times, Constants.DayType day, int week, Constants.CallbackFunction callbackFunc = null, Constants.ClockImageType clockType = Constants.ClockImageType.HOUR_GLASS) { speed *= speedMutiplier; speedUp = true; expectingTime = times; expectingdDay = day; expectingWeek = week; expectHandler = callbackFunc; Blocker.SetActive(true); ClockImage.SetActive(true); ClockImage.GetComponent <Animator>().runtimeAnimatorController = imageAnimators[(byte)clockType]; }
public void SpendTime(float hourMultiPlier = 1.0f, Constants.CallbackFunction callbackFunc = null, Constants.ClockImageType clockType = Constants.ClockImageType.HOUR_GLASS) { float calcTime = envData.times + (Constants.HOUR_SPENT * hourMultiPlier * 3600f); Constants.DayType calcDay = envData.days; int calcWeek = envData.weeks; for (int count = 1; calcTime >= Constants.SECOND_FOR_DAY; ++count) { calcTime -= Constants.SECOND_FOR_DAY; calcDay = envData.days + count; if (calcDay > Constants.DayType.SUNDAY) { calcDay = 0; calcWeek = envData.weeks + 1; } } SpendTime(calcTime, calcDay, calcWeek, callbackFunc, clockType); }