public void Awake() { if (TxtDaysOccupied == null) { GameObject UImenu = GameObject.FindGameObjectWithTag("UI"); IM = UImenu.transform.GetComponent("ImageHolder") as ImageHolder; BedroomMenu = UImenu.transform.FindChild("Popups").transform.FindChild("BedroomMenu").gameObject; TxtTitle = BedroomMenu.transform.FindChild("txtTitle").GetComponent<Text>(); TxtDaysOccupied = BedroomMenu.transform.FindChild("txtDaysOccupied").GetComponent<Text>(); TxtCondition = BedroomMenu.transform.FindChild("txtCondition").GetComponent<Text>(); btnRepair = BedroomMenu.transform.FindChild("btn_Repair").GetComponent<Button>(); btnUpgrade2 = BedroomMenu.transform.FindChild("btn_Upgrade2").GetComponent<Button>(); btnUpgrade3 = BedroomMenu.transform.FindChild("btn_Upgrade3").GetComponent<Button>(); btnUpgrade4 = BedroomMenu.transform.FindChild("btn_Upgrade4").GetComponent<Button>(); btnUpgrade5 = BedroomMenu.transform.FindChild("btn_Upgrade5").GetComponent<Button>(); } BedroomBehaviour.AddToRoomList(this); refurbCTR = GameObject.Find("RefurbishmentCTR").GetComponent<Refurbishment>(); }
void Awake() { refurbishmentTab = controller.transform.FindChild ("RefurbishmentCTR").gameObject.GetComponent<Refurbishment>(); staffMenu = GameObject.FindGameObjectWithTag ("StaffingController").GetComponent<StaffMenu> (); bankingTab = controller.transform.FindChild ("BankingController").gameObject.GetComponent<BankingReport>(); emsTab = controller.transform.FindChild("EMSController").gameObject.GetComponent<EMSReport>(); revenueManagementTab = controller.transform.FindChild("RevenueManagerCTR").GetComponent<RevenueManagement>(); randomEvent = controller.transform.FindChild("EventController").GetComponent<RandomEvent>(); rateSetup = controller.transform.FindChild("RatesSetUp").GetComponent<RatesSetup>(); groupController = controller.transform.FindChild("GroupBooking").GetComponent<GroupBookController>(); calendarController = controller.transform.FindChild("CalendarController").GetComponent<CalendarController>(); feedbackController = controller.transform.FindChild("FeedBackController").GetComponent<FeedbackController>(); dataProcessor = GameObject.Find("DataCollection").GetComponent<Serializer_Deserializer>(); assetSwapper = controller.transform.FindChild("AssetController").GetComponent<AssetSwapper>(); toolbar = GameObject.FindGameObjectWithTag("UI").transform.FindChild("OverWorld").GetComponent<ToolbarOptions>(); adController = controller.transform.FindChild("AdvertController").gameObject.GetComponent<Advertisment>(); SingletonCheck(); if(monthlyReports == null){ monthlyReports = new List<MonthlyReport>();//create list on first run. } //Ensure there's a log for this week (special case for 1st time run) if (receptionLogs == null) { receptionLogs = new List<ReceptionLog> (); } if(restaurantBooks == null){ restaurantBooks = new List<RestaurantBook>();//create a new list on first run. } //Ensure there's a log for this week (special case for 1st time run) if (staffingLogs == null) { staffingLogs = new List<StaffingLog> (); } //create the log once. if(balanceSheets == null){ balanceSheets = new List<BalanceSheet>();//create new balance sheet list on first run. } GenerateNewMonthReports (); firstGeneration = true; medianRoomCostWD = rateSetup.medianRoomCostWD; medianRoomCostWE = rateSetup.medianRoomCostWE; }