참고 유튜브 : https://www.youtube.com/watch?v=oQ1toHKSGIQ
- 줌인 줌아웃.
- 뒤로가기 버튼, 홈 버튼, 메뉴 버튼
간단한 예제
using UnityEngine;
public class TouchInput : MonoBehaviour
{
void Update()
{
// 현재 터치된 손가락 수를 가져옵니다.
int touchCount = Input.touchCount;
// 터치된 손가락이 하나 이상일 경우 처리합니다.
if (touchCount > 0)
{
for (int i = 0; i < touchCount; i++)
{
Touch touch = Input.GetTouch(i);
// 터치의 위치를 가져옵니다.
Vector2 touchPosition = touch.position;
// 터치의 상태를 확인합니다.
switch (touch.phase)
{
case TouchPhase.Began:
Debug.Log("터치 시작: " + touchPosition);
break;
case TouchPhase.Moved:
Debug.Log("터치 이동: " + touchPosition);
break;
case TouchPhase.Stationary:
Debug.Log("터치 유지: " + touchPosition);
break;
case TouchPhase.Ended:
Debug.Log("터치 종료: " + touchPosition);
break;
case TouchPhase.Canceled:
Debug.Log("터치 취소: " + touchPosition);
break;
}
}
}
}
}
유니티 믹사모 캐릭터, 애니메이션 적용 및 수정 (0) | 2024.07.09 |
---|---|
유니티 디졸브효과, 사라지는 셰이더, 은신 효과 (0) | 2024.07.07 |
씬 이동하기 (1) | 2024.07.05 |
랜덤으로 오디오 소스 재생시키기 (0) | 2024.07.05 |
enabled, SetActive() 차이 (0) | 2024.07.02 |