public void TapDetected(Vector3 position) { if (paused || ignoreTap) { ignoreTap = false; return; } CheckTappedPosition(position); if (lastTap.transform != null && newLastTap) { Debug.Log("Hit layer = " + lastTap.transform.gameObject.layer + "name = " + lastTap.transform.gameObject.name); if (lastTap.transform.gameObject.layer == floorLayer) { playerTouchMovable.OnTap(position); } else if (lastTap.transform.gameObject.layer == interactableLayer || lastTap.transform.gameObject.layer == npcLayer || lastTap.transform.gameObject.layer == interactableLayer2) { playerTouchMovable.TargetInteractable(lastTap.collider, GetInteractable(lastTap.transform)); } else if (lastTap.transform.gameObject.layer == 5) { if (lastTap.transform.gameObject == TextboxManager.GetInstance().textBackground) { TextboxManager.GetInstance().OnTap(); } else { /*IButton btn = GetButton(lastTap.transform); * if (btn != null) btn.OnTap();*/ } } } }
public void MajorActionCompleted(bool reload) { if (currentTime == TimeEnums.Evening) { //Disable major interactables. Probably should do this in their script. majorActionDone = true; } else { if (reload) { FadeToBlack(); } currentTime = TimeEnums.Evening; TextboxManager.GetInstance().UpdateDateTime(); foreach (IDayTimeChangeListener listener in dayTimeChangeListeners) { listener.DayTimeChange(currentDay, currentTime); } if (reload) { Invoke("FadeOutBlack", 0.5f); } } }
public void OnButtonPressed(int buttonCode) { TextboxManager.GetInstance().DespawnTextButtons(); if (buttonCode == 0) { GameManager.getInstance().ChangeSceneTrapeze(); } }
new public void TapDetected(Vector3 position) { if (ignoreTap) { ignoreTap = false; return; } CheckTappedPosition(position); if (lastTap.transform != null && newLastTap) { Debug.Log(lastTap.transform.gameObject); if (lastTap.transform.gameObject.layer == 5) { if (lastTap.transform.gameObject == TextboxManager.GetInstance().textBackground) { TextboxManager.GetInstance().OnTap(); ignoreTap = false; } } else if (pmt.state == EnumPTrapezeState.InAir) { if (!paused) { Debug.Log(lastTap.transform.name); if (lastTap.transform.gameObject.layer == interactableLayer || lastTap.transform.gameObject.layer == interactableLayer2) { GetInteractable(lastTap.transform).OnInteraction(); } } } } else if (pmt.state == EnumPTrapezeState.OnTrapeze) { if (!paused) { pmt.Jump(); } } }
public void IncrementDay() { FadeToBlack(); switch (currentDay) { case DayEnums.Monday: currentDay = DayEnums.Tuesday; break; case DayEnums.Tuesday: currentDay = DayEnums.Wednesday; break; case DayEnums.Wednesday: currentDay = DayEnums.Thursday; break; case DayEnums.Thursday: currentDay = DayEnums.Friday; break; case DayEnums.Friday: currentDay = DayEnums.Saturday; break; case DayEnums.Saturday: currentDay = DayEnums.Sunday; break; case DayEnums.Sunday: currentDay = DayEnums.Monday; break; } currentTime = TimeEnums.Morning; majorActionDone = false; daysSoFar++; if (daysTillPerformance == 0) { daysTillPerformance = 1; } dayCountdown.text = "Days until performance: " + (daysTillPerformance - (daysSoFar % daysTillPerformance)); if (daysSoFar % daysTillPerformance == 0) { gradedPerformance = true; if (playerAvatar.GetComponent <PlayerManager>().trustDonna >= targetTrustLevel) { duoTrapeze = true; } foreach (IDayTimeChangeListener listener in dayTimeChangeListeners) { listener.PerformanceDay(); } } else { foreach (IDayTimeChangeListener listener in dayTimeChangeListeners) { listener.DayTimeChange(currentDay, currentTime); } } TextboxManager.GetInstance().UpdateDateTime(); Invoke("FadeOutBlack", 0.5f); }