2013년 8월 18일 일요일

Unity_Tilt 형식의 움직임 구현






1
2
3
4
float tiltAng = Input.acceleration.x; // Device의 기울기값(return value = -1~1)
float speed = 60.0f; // move object speed

transform.Translate (new Vector3 (1, 0, 0) * tiltAng * Time.smoothDeltaTime * speed);
 


게임 기획시 tilt(device의 기울기에 따른 움직임)형식의 
움직임으로 게임을 만들고자 기획하였다면 위의 소스를 참고하시면 됩니다. ^^

Categories:

0 개의 댓글:

댓글 쓰기