1using System.Collections;
2using System.Collections.Generic;
4using UnityEngine.Events;
5using UnityEngine.InputSystem;
9[DisallowMultipleComponent]
12 [Header(
"Input Actions")]
13 [SerializeField, Tooltip(
"Toggle head tracking")]
14 private InputAction headTracking =
new(
"Toggle Head Tracking", InputActionType.Value,
"<Keyboard>/o");
16 private Vector3 cameraStartPos;
17 private bool doHeadTracking =
false;
22 (headTracking.GetBindingDisplayString(),
"Toggle head tracking")
29 headTracking.Enable();
36 headTracking.Disable();
49 cameraStartPos = GetComponentInChildren<FollowMotion>().transform.position;
50 GetComponentInChildren<FollowMotion>().enabled =
false;
55 doHeadTracking = !doHeadTracking;
58 GetComponentInChildren<FollowMotion>().enabled =
true;
62 GetComponentInChildren<FollowMotion>().enabled =
false;
63 GetComponentInChildren<FollowMotion>().transform.position = cameraStartPos;
void ToggleHeadTrackAction(InputAction.CallbackContext ctx)
List<(string Key, string Description)> KeyDescriptions()