0
나는 목록의 항목이 있고이 목록에는 스크롤 막대가 있습니다. 스크롤바는 잘 작동하지만 안드로이드 터치 스크린 스크롤 막대는 매우 주석이 많고 사용자 스크롤 막대가 없습니다. 사용자가 목록에서 터치만으로 목록을 스크롤 할 수 있기를 바랍니다. TNX.Android에서 터치 스크린이있는 Unity3d의 스크롤 목록은 어떻게 표시됩니까?
나는 목록의 항목이 있고이 목록에는 스크롤 막대가 있습니다. 스크롤바는 잘 작동하지만 안드로이드 터치 스크린 스크롤 막대는 매우 주석이 많고 사용자 스크롤 막대가 없습니다. 사용자가 목록에서 터치만으로 목록을 스크롤 할 수 있기를 바랍니다. TNX.Android에서 터치 스크린이있는 Unity3d의 스크롤 목록은 어떻게 표시됩니까?
나는 알아 낸다. 터치 스크린 POS를 가져와 이동 범위를 설정해야한다.
scrollPosition1 = GUI.BeginScrollView(Rect (0,400,Screen.width,175),scrollPosition1, Rect (0, 0, 650, 0));
// touch screen
if (Input.touchCount==1 &&Screen.height -Input.GetTouch(0).position.y > 450 - scrollPositionHome.y && Screen.height - Input.GetTouch(0).position.y < 600 - scrollPositionHome.y)
{
var touchDelta2 : Vector2 = Input.GetTouch(0).deltaPosition;
scrollPosition1.x +=touchDelta2.x;
}
GUI.skin.font = fnt;
style.normal.textColor = Color.black;
style.alignment = TextAnchor.MiddleRight;
for (i=0;i < ImgSliderProducts.Length;i++)
{
GUI.DrawTexture(Rect(20+(i* 100),10,100,100), ImgSliderProducts[i],ScaleMode.ScaleToFit,true);
}
GUI.EndScrollView();