【发布时间】:2019-12-20 11:51:12
【问题描述】:
代码:
void Update(){
if (Application.platform == RuntimePlatform.Android) {
foreach (Touch touch in Input.GetTouch()) {
if (touch.fingerId == 0) {
if (!GameManager.instance.isPlaying) {
GameUIManager.instance.showStartGameCanvas (false);
GameManager.instance.isPlaying = true;
myRiggidBody.constraints = RigidbodyConstraints2D.FreezePositionX;
}
isJump = true;
}
}
}
现在出现错误“get touch 方法没有重载需要 0 个参数”
需要帮助;)
【问题讨论】:
-
阅读
Input.GetTouch()描述。它需要一些参数。 -
public static Touch GetTouch(int index) -
您可能更想遍历包含所有触摸信息的
Input.touches。