void Update() { if (Input.GetButtonDown("Horizontal") || Input.GetButtonDown("Vertical") && playerLucRef.balance > 0) { if (ButtonCooler > 0 && ButtonCount == 1 /*Number of Taps you want Minus One*/) { m_isDashing = true; m_dashSidwayes = Input.GetAxisRaw("Horizontal"); m_dashForward = Input.GetAxisRaw("Vertical"); timer = Time.time; playerLucRef.Withdraw(1); particleRef.Play(); } else { ButtonCooler = 0.2f; ButtonCount += 1; } } if (ButtonCooler > 0) { ButtonCooler -= 1 * Time.deltaTime; } else { ButtonCount = 0; } }
private void Update() { if (charContRef.m_isGrounded && Input.GetButtonDown("Jump")) { isJumping = true; } if (isJumping && Input.GetButtonUp("Jump")) { isJumping = false; doubleJumpFlag = true; } if (doubleJumpFlag) { if (Input.GetButtonDown("Jump") && playerLucContRef.balance >= 1 && doubleJumpFlag) { isDblJumping = true; timer = Time.time; playerLucContRef.Withdraw(1); } if (Input.GetButton("Jump") && isDblJumping) { if (Time.time - timer < jumpDeration) { //rigBodRef.useGravity = false; playerRef.GetComponent <Rigidbody>().AddForce(Vector3.up * doubleJumpForce, ForceMode.Acceleration); } else { isJumping = false; isDblJumping = false; doubleJumpFlag = false; } } if (Input.GetButtonUp("Jump") && isDblJumping) { isJumping = false; isDblJumping = false; doubleJumpFlag = false; } if (!doubleJumpFlag) { //rigBodRef.useGravity = true; } if (charContRef.m_isGrounded) { isJumping = false; isDblJumping = false; doubleJumpFlag = false; } } }
void Update() { if (Input.GetAxis("Horizontal") != 0 || Input.GetAxis("Vertical") != 0 && !m_isDashing) { if (Input.GetButtonDown("Dash") && playerLucRef.balance > 0) { m_isDashing = true; timer = Time.time; playerLucRef.Withdraw(1); particleRef.Play(); } } }
public void Update() { if (!m_draining) { m_DrainEffect.Stop(); } else { Debug.Log("in!"); m_resCont.Withdraw(rps); m_plrResCont.Deposit(rps); } //transform.localScale = new Vector3(m_resCont.balance, m_resCont.balance, m_resCont.balance); m_draining = false; }