Skip to content

Commit

Permalink
MobileInput_3
Browse files Browse the repository at this point in the history
MobileInput_3
  • Loading branch information
woojin211 committed Jun 4, 2024
1 parent 04f2122 commit e6279ba
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 1 deletion.
29 changes: 28 additions & 1 deletion Assets/2Scripts/MobileInputManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,33 @@ void Start()

void Update()
{

isLeft = false;
isRight = false;
isUp = false;
isDown = false;

for (int i=0; i < Input.touchCount; i++)
{
Touch touch = Input.GetTouch(i);

switch (touch.phase)
{
case TouchPhase.Began: // at first

break;
case TouchPhase.Moved: // moving
if (fingerId == touch.fingerId)
{

}
break;
case TouchPhase.Ended: // del
if (fingerId == touch.fingerId)
{
fingerId = -1;
}
break;
}
}
}
}
11 changes: 11 additions & 0 deletions Assets/2Scripts/MobileInputManager.cs.meta

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit e6279ba

Please sign in to comment.