using System.Linq; using System.Collections; using System.Collections.Generic; using UnityEngine; public class InputHandler : MonoBehaviour, IGameComponent { private Transform cameraTransform; void Awake() { cameraTransform = transform; } void Start() { GameSystem.Instance.AddGameComponent(this); Input.gyro.enabled = true; } public void OnUpdate() { var phoneRotation = Input.gyro.attitude; cameraTransform.rotation = phoneRotation; cameraTransform.Rotate(0, 0, 180, Space.Self); cameraTransform.Rotate(90, 180, 0, Space.World); } public void OnFixedUpdate() { } public void OnLateUpdate() { } public void OnDestroy() { GameSystem.Instance.RemoveGameComponent(this); } }