Code cleanup.

This commit is contained in:
2023-04-22 21:08:06 +08:00
parent 2784544884
commit d72afaa75b
5 changed files with 14 additions and 17 deletions

View File

@@ -59,11 +59,8 @@ namespace Cryville.Common.Unity.Input {
var t = unity::Input.GetTouch(i);
Vector2 pos = UnityCameraUtils.ScreenToWorldPoint(t.position);
var vec = new InputVector(time, pos);
if (t.phase == TouchPhase.Began || t.phase == TouchPhase.Stationary || t.phase == TouchPhase.Moved) {
handler.Feed(0, t.fingerId, vec);
}
else if (t.phase == TouchPhase.Ended || t.phase == TouchPhase.Canceled) {
handler.Feed(0, t.fingerId, vec);
handler.Feed(0, t.fingerId, vec);
if (t.phase == TouchPhase.Ended || t.phase == TouchPhase.Canceled) {
handler.Feed(0, t.fingerId, new InputVector(time));
}
}