private void InitMonth() { if (this.daysPassed == -1) { this.daysPassed = this.gameManager.GetDaysPassed(); } for (int i = 0; i < this.numDays; i++) { GameObject day = gameObject.transform.GetChild(i).gameObject; DayUI script = day.GetComponent <DayUI>(); script.SetDay(i); script.SetRent(this.gameManager.GetRentByDay(i)); if (i < this.daysPassed) { script.SetPast(); } else if (i == this.daysPassed) { NotifyCurrentDay?.Invoke(day.transform); script.SetCurrent(); } else { script.SetFuture(); } } }
public void loadElements() { DayList.Children.Clear(); setElements(); DateTime startTimeSelect = days[0].Date.Date; DateTime endTimeSelect = days[days.Count - 1].Date.Date; List <calendarObject> cObjs = AppCore.dCore.CalendarObjectManager.ListAllCalendarObjectsBySelection(Core.AppCore.mainProjectTableName, CalendarObjectManager.SelectionType.isDateUsed); foreach (Day d in days) { bool isTheSameDay = false; if (d.Date == DateTime.Today.Date) { isTheSameDay = true; } DayUI day = new DayUI(d, isTheSameDay); foreach (calendarObject c in cObjs) { // if the date can be displayed somewhere if (Date.isDateBetween(c, startTimeSelect.Date, endTimeSelect.Date)) { day.elements.Add(c); } } day.loadComponements(); DayList.Children.Add(day); } }
private void Awake() { _energyText = EnergyUI.GetComponentInChildren <TextMeshProUGUI>(); _moneyText = MoneyUI.GetComponentInChildren <TextMeshProUGUI>(); _personalText = PersonalHappinessUI.GetComponentInChildren <TextMeshProUGUI>(); _familyText = FamilyHappinessUI.GetComponentInChildren <TextMeshProUGUI>(); _careerText = CareerUI.GetComponentInChildren <TextMeshProUGUI>(); _dayText = DayUI.GetComponentInChildren <TextMeshProUGUI>(); }
private void Start() { dayUI = GetComponent <DayUI>(); ratingCalculator = GetComponent <RatingCalculator>(); starRatingUI = GetComponent <StarRatingUI>(); descriptionLibrary = GetComponent <DescriptionLibrary>(); StartDay(); }