// Update is called once per frame void Update() { Mouvement(); if (Input.GetMouseButtonDown(0) && isGrounded() == true) { _palyerAnim.Attack(); } }
void CheckAttack() { _grounded = IsGrounded(); if (_grounded && CrossPlatformInputManager.GetButtonDown("A_Button")) { _anim.Attack(); } }
// Update is called once per frame void Update() { Movement(); if (Input.GetMouseButtonDown(0) && IsGrounded() == true || Input.GetKeyDown(KeyCode.RightControl) && IsGrounded() == true) { _playerAnim.Attack(); } }
// Update is called once per frame void Update() { Movement(); if (Input.GetMouseButtonDown(0)) { _playerAnim.Attack(); } }
void Update() { Movement(); //CheckGrounded(); if (Input.GetMouseButtonDown(0) && CheckGrunded() == true) { _anim.Attack(); } }
void Attack() { isGrounded = IsGrounded(); if (CrossPlatformInputManager.GetButtonDown("A_Button") && isGrounded) { playerAnimation.Attack(); } }
void Attack() { _grounded = IsGrounded(); if (Input.GetKeyDown(KeyCode.Mouse0) && _grounded) { _rb.velocity = new Vector2(0, _rb.velocity.y); _playerAnimation.Attack(); } }
// Update is called once per frame void Update() { Movement(); if (Input.GetMouseButtonDown(0) && IsGrounded()) { anim.Attack(); } }
// Update is called once per frame void Update() { Movement(); if (Input.GetButtonDown("Fire1")) { _playAnim.Attack(); } }
void Attack() { RaycastHit2D hit = Physics2D.Raycast(transform.position, Vector2.down, 0.8f, 1 << 8); if (Input.GetKeyDown(KeyCode.Mouse0) && hit.collider != null) { _anim.Attack(); } }
void Update() { Movement(); //Atağı A butonun aayarladık if (CrossPlatformInputManager.GetButtonDown("A_Button") && IsGrounded() == true) { _playerAnim.Attack(); } }
// Update is called once per frame void Update() { Movement(); if (CrossPlatformInputManager.GetButtonDown("A_Button") && IsGrounded()) { _playerAnim.Attack(); } }
// Update is called once per frame void Update() { Movement(); if (Input.GetMouseButtonDown(0) && IsGrounded()) { _playerAnimation.Attack(); } }
private void Update() { Movement(); if (CrossPlatformInputManager.GetButtonDown("A_Button") && IsGrounded() && Health > 0) { PlayerAnimation.Attack(); SwordAttackSound.pitch = Random.Range(0.9f, 1.1f); SwordAttackSound.Play(); } }
private void PerformAttack() //fire laser/bullet { /* * if (!onGround) * { * return; * } */ if (myVelocity.x != 0) { return; } /* //this was for shooting a bullet, but my guy swings a sword so it's not what I want * Debug.Log("shoot laser/bullet"); * Vector3 pos = firePoint.transform.position; * Quaternion rot = firePoint.transform.rotation; * * if (getLastDirection() == "up") * { * Debug.Log(getLastDirection()); * pos.x = 0 + this.transform.position.x; * pos.y = 2.1f + this.transform.position.y; * rot = Quaternion.Euler(0, 0, 90); * * } * if (getLastDirection() == "down") * { * Debug.Log(getLastDirection()); * pos.x = 0 + this.transform.position.x; * pos.y = -0.1f + this.transform.position.y; * rot = Quaternion.Euler(0, 0, -90); * } * if (getLastDirection() == "right") * { * Debug.Log(getLastDirection()); * pos.x = 0.7f + this.transform.position.x; * pos.y = 0.9f + this.transform.position.y; * rot = Quaternion.Euler(0, 0, 0); * } * if (getLastDirection() == "left") * { * Debug.Log(getLastDirection()); * pos.x = -0.8f + this.transform.position.x; * pos.y = 0.9f + this.transform.position.y; * rot = Quaternion.Euler(0, 0, 180); * * } * GameObject bullet = Instantiate(bulletPrefab, pos, rot); * Destroy(bullet, 0.5f); */ _playerAnim.Attack(); //cue attack animation }
void Attack() { if (!canAttack) { return; } #if MOBILE_INPUT if (CrossPlatformInputManager.GetButtonDown("Attack") && IsGrounded()) { m_playerAnim.Attack(); } #endif #if !MOBILE_INPUT if (Input.GetMouseButtonDown(0) && IsGrounded()) { m_playerAnim.Attack(); } #endif }
void Attack() { if (!canAttack) { return; } if ((CrossPlatformInputManager.GetButtonDown("A_Button")) && IsGrounded()) { m_playerAnim.Attack(); } }
// Update is called once per frame void Update() { Movement(); isGrounded(); if (CrossPlatformInputManager.GetButtonDown("A_button") && _grounded == true) // Input.GetMouseButtonDown(0) { StartCoroutine(afterswing()); _playerAnim.Attack(); onHitPlayPlayer.Play(); } }
private void Attack(bool isGrounded) { bool attack = CrossPlatformInputManager.GetButtonDown("A_Button") || Input.GetMouseButtonDown(1); if (attack) { if (isGrounded) { _playerAnimation.Attack(); } } }
// Update is called once per frame void Update() { var move = Movement(); _rigid.velocity = new Vector2(move * _speed, _rigid.velocity.y); _playerAnimation.Move(move); if (CrossPlatformInputManager.GetButtonDown("A_Button") && IsGrounded() == true) { _playerAnimation.Attack(); } }
// Update is called once per frame void Update() { if (_isDead) { return; } Movement(); if (CrossPlatformInputManager.GetButtonDown("A_Button") && isGrounded()) { _playerAnim.Attack(); } }
private void Attack() { FindObjectOfType <AudioManager>().Play("SwordSwing"); anim.Attack(); Collider2D[] enemiesToDamage = Physics2D.OverlapCircleAll( attackPos.position, attackRange, whatIsEnemy); foreach (var enemy in enemiesToDamage) { enemy.GetComponent <Enemy>().TakeDamage(damage); } }
void FixedUpdate() { isGrounded(); //Check if player is on ground Movement(); //Handle Movement if (verticalInput != 0 && isGrounded() == true) //Jump Conditions { Jump(); //Jump Method } if (attack == true && isGrounded() == true) //Attack Conditions { playerAnimation.Attack(); //playerAnimation class call method } }
public void Attack() { if (Input.GetKeyDown(KeyCode.Space)) { playerAnimation.Attack(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical")); for (int i = 0; i < enemyInRange.Count; i++) { if (!enemyInRange[i].gameObject.GetComponent <EnemyStats>().dead) { enemyInRange[i].gameObject.GetComponent <EnemyStats>().Hit(); } } } }
void HandleAnimations() { if (actionAnimator == "MOVE") { pAnim.Movement(movement.moving); } else if (actionAnimator == "ATTACK") { pAnim.Attack(); } else { pAnim.Movement(false); } }
// Update is called once per frame private void Update() { if (isDead) { return; } Move(); CheckGrounded(); if (Input.GetKeyDown(KeyCode.Mouse0) && isGrounded) { pAnimation.Attack(); } }
void Update() { if ((playerMovement.isRunning && Input.GetButtonDown("Fire1")) || Input.GetButtonDown("Fire3")) { playerAnimation.Attack(); attackCollider.enabled = true; } if (timer >= impactTime) { timer = 0f; attackCollider.enabled = false; } if (attackCollider.enabled) { timer += Time.deltaTime; } }
// Update is called once per frame private void Update() { if (_isDead) { return; } Movement(); if (/*Input.GetMouseButtonDown(0) || */ CrossPlatformInputManager.GetButtonDown("A_Button") && IsGrounded()) { if (!GameManager.Instance.FlameEnabled) { _playerAnim.Attack(); } else { _playerAnim.FlameAttack(); } } }
void Movement() { float move = Input.GetAxisRaw("Horizontal"); Flip(move); if (Input.GetKeyDown(KeyCode.Return) || Input.GetKeyDown(KeyCode.Mouse0) && _grounded) { _playerAnim.Attack(); } if (Input.GetKeyDown(KeyCode.Space) && _grounded == true) { _rigid.velocity = new Vector2(_rigid.velocity.x, _jumpForce); _grounded = false; _resetJumpNeeded = true; StartCoroutine(ResestJumpNeededRoutine()); _playerAnim.Jump(true); } _rigid.velocity = new Vector2(move * _speed, _rigid.velocity.y); _playerAnim.Move(move); }
private void Movement() { float Hmove = Input.GetAxisRaw("Horizontal"); float Vmove = Input.GetAxisRaw("Vertical"); _grounded = Isground(); if (Input.GetKeyDown(KeyCode.Mouse0)) { _Movedirection.Attack(); } if (Input.GetKeyDown(KeyCode.Space) && Isground() == true) { _rg.velocity = new Vector2(_rg.velocity.x, _jumpheight); _Movedirection.Jump(true); StartCoroutine(changjumpanim()); } Flip(Hmove); _rg.velocity = new Vector2(Hmove * _Speed, _rg.velocity.y); _Movedirection.Move(Hmove); }