c# - 游戏有时无法识别触摸
问题描述
我使用 unity 制作了一个游戏,并在 google play store 上发布了它。但是,它有一些问题。当我开始游戏一段时间后,它无法识别我的触球。我不知道为什么。这是使玩家移动的更新功能:
public void Update(){
Vector2 vel=rb.velocity;
float ang = Mathf.Atan2(vel.y,10)*Mathf.Rad2Deg;
transform.rotation = Quaternion.Euler(new Vector3(0,0,ang));
if (Input.GetMouseButton(0))
{
rb.AddForce(Vector2.up * gravity * Time.deltaTime * 1500f);
}
}
我应该使用触摸而不是 Input.GetMouseButton(0) 还是还有其他问题? 如果你想检查,这是我的游戏
编辑:它可以识别但需要太多时间
解决方案
推荐阅读
- python - 匹配两个数据帧的列,如果匹配,则从第一个数据帧中获取相应的列
- tensorflow - 我应该如何理解 tensorflow 对象检测 api 中的预热学习率?
- java - 位于服务器中的 Thymeleaf 图像绑定
- c# - PDF 损坏的 iTextSharp C#
- php - 来自使用 json 数据的 ajax 成功响应的未定义值
- git - git:在合并时取消暂存更改而不影响将来的合并
- c# - 无法将 Base64 图像设置为背景图像 MVC
- android - 未生成 Sceneform 1.15.0 .sfa 和 .sfb 文件
- identity - 对设备 CA 密钥和设备身份密钥使用 TPM 密钥句柄
- javascript - 我如何在 ngx-pagination 的数组上使用 ngFor* 将分页控制数字(1 2 3)更改为其他值,例如“Anything1 Anything2 ...”?