void Update() { if (Input.GetMouseButtonDown(0)) { m_anchorSystem.AttachToNearestAnchor(this); } else if (Input.GetMouseButtonUp(0)) { m_anchorSystem.Detach(this); } }
void Update() { if (!pauseMenu.isPaused && !isDead) { if (Input.GetMouseButtonDown(0)) { m_anchorSystem.AttachToNearestAnchor(this); m_rigidbody.AddForce(new Vector3(m_rigidbody.transform.localScale.x * impulseForce, 0, 0), ForceMode2D.Force); playerAnim.SetBool("isSlinging", true); } else if (Input.GetMouseButtonUp(0)) { Debug.Log("INPUT"); playerAnim.SetBool("isSlinging", false); m_rigidbody.AddForce(new Vector3(m_rigidbody.transform.localScale.x * impulseForce, 0, 0), ForceMode2D.Impulse); m_anchorSystem.Detach(this); } } }