0
我跳過GameObject遇到問題。我已經完成了Action largjump和shortjump。但問題是我怎樣才能做出條件聲明。我想區分弱鍵盤輸入和強鍵盤輸入。短跳和跳躍與鍵盤輸入的力量
這是我的代碼。
if (Input.GetButtonDown("Jump"))
{
float JumpTime = 0;
JumpTime = JumpTime + Time.deltaTime;
if (Input.GetButtonUp("Jump") && JumpTime < 0.3f)
{
playerCtrl.ActionShortJump();
}
else if (Input.GetButtonUp("Jump") && JumpTime > 0.3f)
{
playerCtrl.ActionJump();
}
}