void OnUpdate() { if (Input.GetButtonDown(Constants.InputNames.InteractButton)) { var player = DreamOneController.CurrentState.References.PlayerController; if (GameObjectUtil.IsCloserThan(player.transform, transform, InteractionRadius)) { DreamOneController.OnInteractWithPhone(); } } }
public void OnUpdate() { if (Input.GetButtonDown(Constants.InputNames.InteractButton)) { var player = DreamOneController.CurrentState.References.PlayerController; var camera = player.CameraTrans; var dir = (transform.position - camera.position).normalized; var dot = Vector3.Dot(dir, camera.forward); if (dot > .9f) { if (GameObjectUtil.IsCloserThan(player.transform, transform, InteractionRadius)) { DreamOneController.InteractedWithPaperMessage(); } } } }
private static IEnumerator InternalExecuteDreamOne() { PrepareForDream(); var dreamOne = DataHolder.DreamReferences.DreamOne; var sceneLoad = SceneManager.LoadSceneAsync(dreamOne.Scene, LoadSceneMode.Additive); yield return(AnnouncementUtil.RunAnnouncement(dreamOne.DreamAnnouncement)); yield return(sceneLoad); AnnouncementUtil.HideAnnouncement(); var dreamOneComponent = GameObject.FindObjectOfType <DreamOneReferences>(); DebugUtil.Assert(dreamOneComponent == null, "No dream one component on dream one scene!"); DreamOneController.Run(dreamOneComponent, EndDreamOne); }