/* Initialzies the canvas to use current information */ public void Init() { warning.SetActive(false); afternoon.SetActive(false); evening.SetActive(false); night.SetActive(false); morning.SetActive(false); daytime = clock.currentDayTime; checkmeds(); /* Allow time skip only if all meds are given and the player actually has patients and current time isn't between midnight and 7*/ if (!allMedsGiven && npcManager.responsibilityNpcs.Count > 0) { transform.FindChild("Background").FindChild("Text").gameObject.SetActive(false); warning.SetActive(true); warning.GetComponent <Text>().text = "You haven't administrated all the medicine yet!"; } else if (npcManager.responsibilityNpcs.Count == 0 || (clock.currentHours > 0 && clock.currentHours < 7)) { transform.FindChild("Background").FindChild("Text").gameObject.SetActive(false); warning.SetActive(true); warning.GetComponent <Text>().text = "You can't skip time right now!"; } else { transform.FindChild("Background").FindChild("Text").gameObject.SetActive(true); warning.SetActive(false); switch (daytime) { case ClockTime.DayTime.MORNING: afternoon.SetActive(true); break; case ClockTime.DayTime.AFTERNOON: evening.SetActive(true); break; case ClockTime.DayTime.EVENING: night.SetActive(true); break; case ClockTime.DayTime.NIGHT: morning.SetActive(true); break; } } }
public void startMinigame() { kasiDesi = false; if (GameObject.FindGameObjectWithTag("Clock").GetComponent <ClockTime>() != null) { time = GameObject.FindGameObjectWithTag("Clock").GetComponent <ClockTime>().currentDayTime; } uiManager.pause(true); minigameCanvas.SetActive(true); uiCanvas.SetActive(false); kasDesObj = GameObject.FindGameObjectWithTag("KasDes"); kasDesAnim = kasDesObj.GetComponent <Animation>(); drops = GameObject.FindGameObjectsWithTag("Drop"); spawnDrops = true; active = true; npcList.Clear(); foreach (GameObject n in npcManager.responsibilityNpcs) { if (n != null) { npcList.Add(n); } } currNpc = 0; GetComponent <MedCabInventory>().Init(); if (npcList.Count == 0) { return; } GameObject npcObj = npcList[currNpc]; if (npcObj == null) { return; } NPC npc = npcObj.GetComponent <NPC>(); showMedCard(npc); }
void Update() { currentDayTime = GameObject.FindGameObjectWithTag("Clock").GetComponent <ClockTime>().currentDayTime; switch (currentDayTime) { case ClockTime.DayTime.MORNING: gameObject.GetComponent <Image>().sprite = dayTimeIcons[0]; break; case ClockTime.DayTime.AFTERNOON: gameObject.GetComponent <Image>().sprite = dayTimeIcons[1]; break; case ClockTime.DayTime.EVENING: gameObject.GetComponent <Image>().sprite = dayTimeIcons[2]; break; case ClockTime.DayTime.NIGHT: gameObject.GetComponent <Image>().sprite = dayTimeIcons[3]; break; } }