public bool ghuestHasEvent(Ghuest g, GhuestEvent e) { foreach (GhuestEvent _e in g.events) { if (_e == e) { return(true); } } return(false); }
public void EndEvent() { timer = 0.0f; triggerTimer = UnityEngine.Random.Range(minTimer, maxTimer); if (ghuestHasEvent(currentGhuest, GhuestEvent.PHONECALL) && currentGhuest.mainKnot != "RANDOM_GUEST") { checkedGuests.Add(currentGhuest); } currentGhuest = null; ghuestHeadHolder.gameObject.SetActive(false); currentEvent = GhuestEvent.NONE; checkInStep = CheckInStep.WRITE_NAME; NarrativeUI.ui._inkStory.variablesState["checkInStep"] = (int)checkInStep; }
public void PopGhuest(Ghuest g = null) { if (g != null) { currentGhuest = g; } else { currentGhuest = new Ghuest(getRandomName(false), "RANDOM_GUEST"); } if (currentGhuest.mainKnot == "STORY_GUEST_2") { Desk.d.StartFadingRadio(); } ghuestHeadHolder.gameObject.SetActive(true); if (currentGhuest.headSprite == null) { ghuestHeadHolder.sprite = headRandom; ghuestHeadHolder.color = availableColors[UnityEngine.Random.Range(0, availableColors.Count)]; } else { ghuestHeadHolder.sprite = currentGhuest.headSprite; ghuestHeadHolder.color = Color.white; } AudioManager.am.PlayBell(); timer = 0.0f; ghuestCount++; //currentGhuest.events.Remove(currentGhuest.events[0]); lastName = currentGhuest.name; NarrativeUI.ui.SwitchActive(true); if (currentGhuest.events != null && currentGhuest.events.Count != 0) { currentEvent = currentGhuest.events[0]; NarrativeUI.ui.ReadKnot(currentGhuest.mainKnot + "." + currentEvent.ToString(), currentGhuest.name); } else { currentEvent = GhuestEvent.SPECIAL; NarrativeUI.ui.ReadKnot(currentGhuest.mainKnot, currentGhuest.name); } }
// Update is called once per frame void Update() { if (currentEvent == GhuestEvent.NONE && !Desk.d.phone.isCalling && !BinaryRiver.br.isReading && !NarrativeUI.ui.STOPEVERYTHING) { timer += Time.deltaTime; if (timer >= triggerTimer) { Ghuest g = null; if (customGuests != null) { foreach (Ghuest ch in customGuests) { if (ch.indexCheckin == ghuestCount) { g = ch; break; } } } PopGhuest(g); } } }