unity3d开发3D 游戏android游戏触摸屏设置的编程也在unity3d中进行还是在eclipse中
2个回答
展开全部
unity3d 写代码只要自带的mono , 看android 的日志用eclipse;
// 通过 Input.touches 获得多点触控数据,
void Update ()
{
foreach (Touch touch in Input.touches) {
string action = "";
switch (touch.phase) {
case TouchPhase.Began:
action = "开始";
break;
case TouchPhase.Moved:
action = "移动";
break;
case TouchPhase.Stationary:
action = "停留";
break;
case TouchPhase.Ended:
case TouchPhase.Canceled:
action = "结束";
break;
}
Debug.Log (string.Format ("fingerId:{0},action:{1},position:{2}", touch.fingerId, action, touch.position));
}
}
// 通过 Input.touches 获得多点触控数据,
void Update ()
{
foreach (Touch touch in Input.touches) {
string action = "";
switch (touch.phase) {
case TouchPhase.Began:
action = "开始";
break;
case TouchPhase.Moved:
action = "移动";
break;
case TouchPhase.Stationary:
action = "停留";
break;
case TouchPhase.Ended:
case TouchPhase.Canceled:
action = "结束";
break;
}
Debug.Log (string.Format ("fingerId:{0},action:{1},position:{2}", touch.fingerId, action, touch.position));
}
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询