private void OnTriggerEnter2D(Collider2D collider) { GameObject obj = collider.gameObject; if (!obj.GetComponent <Defender>()) { return; } anim.SetBool("isAttacking", true); attacking.Attack(obj); }
void Update() { //If he is not jumping... if (!isJumping) { //See if button is pressed... isJumping = CrossPlatformInputManager.GetButtonDown("Jump"); } if (CrossPlatformInputManager.GetButtonDown("Fire1")) { c_attacking.Attack(); } }
void Update() { lookAt(); //jumping Move(); Turning(); //criar um script apenas para attack if (Input.GetKeyUp(KeyCode.Mouse0)) { attack.Attack(); } else { anim.SetBool("isShooting", false); } //Nao esquecer }