late goodbye

This commit is contained in:
2022-11-14 20:02:23 +05:00
parent d540eb1e06
commit 7ba948e4af
43 changed files with 11842 additions and 145 deletions
+8 -6
View File
@@ -4,9 +4,11 @@ using System.Collections.Generic;
using UnityEngine;
public class InputHandler : MonoBehaviour, IGameComponent
public class InputHandler : MonoBehaviour
{
[SerializeField] private float speed = 2;
private Transform cameraTransform;
private Quaternion lastRotation;
void Awake()
{
@@ -15,14 +17,14 @@ public class InputHandler : MonoBehaviour, IGameComponent
void Start()
{
GameSystem.Instance.AddGameComponent(this);
// GameSystem.Instance.AddGameComponent(this);
Input.gyro.enabled = true;
}
public void OnUpdate()
public void Update()
{
var phoneRotation = Input.gyro.attitude;
cameraTransform.rotation = phoneRotation;
cameraTransform.rotation = lastRotation;
lastRotation = Quaternion.Lerp(transform.rotation, Input.gyro.attitude, speed * Time.deltaTime);
cameraTransform.Rotate(0, 0, 180, Space.Self);
cameraTransform.Rotate(90, 180, 0, Space.World);
@@ -33,6 +35,6 @@ public class InputHandler : MonoBehaviour, IGameComponent
public void OnDestroy()
{
GameSystem.Instance.RemoveGameComponent(this);
// GameSystem.Instance.RemoveGameComponent(this);
}
}