2using UnityEngine.SceneManagement;
3using UnityEngine.InputSystem;
22 [Header(
"References")]
27 [Header(
"Animator Parameters")]
36 [Header(
"Prefabs & References")]
39 [SerializeField]
private AudioSource
waitBGM =
null;
40 [SerializeField]
private AudioSource
playBGM =
null;
76 gameInputActions.Game.Start.performed +=
OnStart;
77 gameInputActions.Game.Restart.performed +=
OnRestart;
78 gameInputActions.Game.Continue.performed +=
OnContinue;
79 gameInputActions.Game.Quit.performed +=
OnQuit;
90 gameInputActions.Game.Start.performed -=
OnStart;
91 gameInputActions.Game.Restart.performed -=
OnRestart;
92 gameInputActions.Game.Continue.performed -=
OnContinue;
93 gameInputActions.Game.Quit.performed -=
OnQuit;
120 Debug.Log(
"Connected displays: " + Display.displays.Length);
121 for (
int i = 1; i < Mathf.Min(Display.displays.Length,
numDisplays); i++)
123 Display.displays[i].Activate();
144 foreach (var cloud
in clouds)
188 foreach (var cloud
in clouds)
201 private void OnStart(InputAction.CallbackContext context) {
206 private void OnRestart(InputAction.CallbackContext context) {
207 SceneManager.LoadScene(SceneManager.GetActiveScene().name);
210 private void OnContinue(InputAction.CallbackContext context) {
218 private void OnQuit(InputAction.CallbackContext context) { Application.Quit(); }
223 if (animRef.animator !=
null)
225 animRef.animator.SetBool(animRef.pushToTalkStartedBool,
true);
226 animRef.animator.SetBool(animRef.pushToTalkCancelledBool,
false);
235 AudioSource sfx = animRef.GetRandomSFXVariant();
241 if (animRef.animator !=
null)
243 animRef.animator.SetBool(animRef.pushToTalkStartedBool,
false);
244 animRef.animator.SetBool(animRef.pushToTalkCancelledBool,
true);
Helper class to group references needed for animation.
AudioSource GetRandomSFXVariant()
string pushToTalkCancelledBool
string pushToTalkStartedBool
string actorIsTalkingBool
AudioSource[] sfxVariants
GameManager controls the gameplay animation and audio.
Spelunx.Orbbec.BodyTrackerManager bodyTrackerManager
FSM.FiniteStateMachine fsm
void OnPushToTalkCancelled(InputAction.CallbackContext context)
void OnQuit(InputAction.CallbackContext context)
void OnContinue(InputAction.CallbackContext context)
GameInputActions gameInputActions
@ Finish
Game has finished.
@ Play
Game is in progress.
@ Idle
Wait for the player to start the game.
void OnPushToTalkStarted(InputAction.CallbackContext context)
AnimationReferences[] animationReferences
void OnRestart(InputAction.CallbackContext context)
void OnStart(InputAction.CallbackContext context)
EchoTrio.UI.FadeEffect[] clouds
Finite state machine class to handle state transitions and updates.
void UnsubscribeFromEvent(string eventName, UnityAction unityAction)
void TriggerEvent(string eventName)
void SubscribeToEvent(string eventName, UnityAction unityAction)
static GameEventSystem GetInstance()