Transforms input from screen point to world point.

This commit is contained in:
2022-11-06 13:20:26 +08:00
parent d58e255b3f
commit b92a21951d
5 changed files with 27 additions and 6 deletions

View File

@@ -55,8 +55,7 @@ namespace Cryville.Common.Unity.Input {
}
void Update() {
double time = Time.timeAsDouble;
Vector2 pos = unity::Input.mousePosition;
pos.y = Screen.height - pos.y;
Vector3 pos = UnityCameraUtils.ScreenToWorldPoint(unity::Input.mousePosition);
handler.Feed(0, 0, new InputVector(time, pos));
}
}