update .gitignore

This commit is contained in:
2022-11-10 13:49:57 +05:00
parent 213707fac7
commit 943eef44e3
23 changed files with 1231 additions and 5022 deletions
+16 -23
View File
@@ -7,29 +7,37 @@ using UnityEngine.InputSystem;
public class InputHandler : MonoBehaviour, IGameComponent
{
enum Axis
{
x,
y,
z,
w
}
private Controls inputSystem;
private Transform cameraTransform;
private float X0;
private float P0;
private readonly float F = 1;
private readonly float Q = 2;
private readonly float Q = 6;
private readonly float H = 1;
private readonly float R = 15;
private float Covariance = .1f;
private float state = 0;
private float[] state = new float[4];
float GetValueAfterFilter(float value)
float GetValueAfterFilter(float value, Axis axis)
{
X0 = F * state;
X0 = F * state[(int)axis];
P0 = F * Covariance * F + Q;
var K = H *P0 / (H * P0 * H + R);
state = X0 + K * (value - H * X0);
state[(int)axis] = X0 + K * (value - H * X0);
Covariance = (1 - K * H) * P0;
return state;
return state[(int)axis];
}
void Awake()
@@ -61,24 +69,9 @@ public class InputHandler : MonoBehaviour, IGameComponent
.Rotation
.Gyroscope
.ReadValue<Quaternion>();
cameraTransform.rotation = phoneRotation;
// phoneRotation = new Quaternion
// (
// GetValueAfterFilter(phoneRotation.x),
// GetValueAfterFilter(phoneRotation.y),
// GetValueAfterFilter(phoneRotation.z),
// GetValueAfterFilter(phoneRotation.w)
// );
Quaternion filtredRotation = new Quaternion
(
GetValueAfterFilter(phoneRotation.x),
GetValueAfterFilter(phoneRotation.y),
GetValueAfterFilter(phoneRotation.z),
GetValueAfterFilter(phoneRotation.w)
);
cameraTransform.rotation = filtredRotation;
cameraTransform.Rotate(0, 0, 180, Space.Self);
cameraTransform.Rotate(90, 180, 0, Space.World);
}
+31
View File
@@ -0,0 +1,31 @@
using System.Collections;
using System.Collections.Generic;
using DG.Tweening;
using UnityEngine;
using UnityEngine.SceneManagement;
[RequireComponent(typeof(CanvasGroup))]
public class LogoHandler : MonoBehaviour
{
[SerializeField] private CanvasGroup logo;
private CanvasGroup canvasGroup;
IEnumerator Start()
{
DontDestroyOnLoad(gameObject);
canvasGroup = GetComponent<CanvasGroup>();
var sceneLoading = SceneManager.LoadSceneAsync(1, LoadSceneMode.Single);
while(!sceneLoading.isDone)
yield return null;
yield return new WaitForSeconds(2);
logo.DOFade(0, .4f)
.OnComplete(() => canvasGroup
.DOFade(0, .8f)
.OnComplete(() => Destroy(this.gameObject)));
}
}
+11
View File
@@ -0,0 +1,11 @@
fileFormatVersion: 2
guid: 1108ef3d2c569ea479a6d9778b2209a3
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant: