Move part of the input module to Cryville.Input.

This commit is contained in:
2023-05-05 00:40:51 +08:00
parent b143fb49ce
commit 0b2ea3ddbc
62 changed files with 1417 additions and 1602 deletions

View File

@@ -3,8 +3,10 @@ using Cryville.Audio.Source;
using Cryville.Common.Font;
using Cryville.Common.Logging;
using Cryville.Common.Unity;
using Cryville.Common.Unity.Input;
using Cryville.Common.Unity.UI;
using Cryville.Input;
using Cryville.Input.Unity;
using Cryville.Input.Unity.Android;
using FFmpeg.AutoGen;
using Ionic.Zip;
using Newtonsoft.Json;
@@ -12,6 +14,7 @@ using System;
using System.IO;
using UnityEngine;
using Logger = Cryville.Common.Logging.Logger;
using unity = UnityEngine;
namespace Cryville.Crtr {
public static class Game {
@@ -58,7 +61,21 @@ namespace Cryville.Crtr {
GameDataPath = Settings.Default.GameDataPath;
Input.simulateMouseWithTouches = false;
unity::Input.simulateMouseWithTouches = false;
//InputManager.HandlerRegistries.Add(typeof(AndroidAccelerometerHandler));
//InputManager.HandlerRegistries.Add(typeof(AndroidAccelerometerUncalibratedHandler));
//InputManager.HandlerRegistries.Add(typeof(AndroidGameRotationVectorHandler));
//InputManager.HandlerRegistries.Add(typeof(AndroidGravityHandler));
//InputManager.HandlerRegistries.Add(typeof(AndroidGyroscopeHandler));
//InputManager.HandlerRegistries.Add(typeof(AndroidLinearAccelerationHandler));
//InputManager.HandlerRegistries.Add(typeof(AndroidMagneticFieldHandler));
//InputManager.HandlerRegistries.Add(typeof(AndroidMagneticFieldUncalibratedHandler));
//InputManager.HandlerRegistries.Add(typeof(AndroidRotationVectorHandler));
InputManager.HandlerRegistries.Add(typeof(AndroidTouchHandler));
InputManager.HandlerRegistries.Add(typeof(UnityGuiInputHandler<UnityKeyReceiver>));
InputManager.HandlerRegistries.Add(typeof(UnityGuiInputHandler<UnityMouseReceiver>));
InputManager.HandlerRegistries.Add(typeof(UnityMouseHandler));
InputManager.HandlerRegistries.Add(typeof(UnityTouchHandler));
InputManager = new InputManager();
#if UNITY_EDITOR_WIN