我正在尝试制作一个平台游戏,我想在x秒之后恢复平台的重力.但它提供了一个无法使用的complile错误,因为void不是内部接口类型.我是个笨蛋,我迫不及待地继续我的项目.谢谢你的时间,我很抱歉我糟糕的英语.
private void OnCollisionEnter(Collision collision)
{
if (collision.gameObject.name == "Platform(Clone)")
{
numberOfJumps = 2;
Debug.Log("Platform hit");
}
//Maake platforms fall
yield return new WaitForSeconds(2f);
collision.rigidbody.useGravity = enabled;
yield return null;
}
Run Code Online (Sandbox Code Playgroud)