void Update() { if (Application.platform == RuntimePlatform.WindowsPlayer || Application.platform == RuntimePlatform.WindowsEditor) { if (Input.GetMouseButton(0)) { AttackA = true; } if (Input.GetMouseButton(1)) { AttackB = true; } } if (AttackA) { _PlayerBehaviour.Attack(0); AttackA = false; } if (AttackB) { _PlayerBehaviour.Attack(1); AttackB = false; } }
void attackGestureRecognized() { m_playerBehavior.Attack(); Instantiate(m_psHitTheBeat, m_rhythmIdicator.transform.position, Quaternion.identity); m_OnlyOneGesturePerBeat = false; m_rhythmIdicator.ExecuteEnemyActions(); }
// Update is called once per frame void Update() { Vector3 axis = Vector3.zero; Vector2 axis2 = Vector2.zero; Vector2 axis3 = Vector2.zero; if (!mobileCtrl && !xboxController) { axis2.x = Input.GetAxis("Horizontal"); //axis.z = Input.GetAxis("Vertical"); axis2.y = Input.GetAxis("Vertical"); } if (xboxController) { axis3.x = Input.GetAxisRaw("J_Horizontal"); axis3.y = Input.GetAxisRaw("J_Vertical"); } else { axis.x = joystick.Direction.x; axis.z = joystick.Direction.y; } player.Move(axis2); player.Move(axis3); if (Input.GetButtonDown("Jump") && !ui.cooling) { player.Attack(); ui.StartCooldown(); //cooldown } if (Input.GetKeyDown(KeyCode.R) || Input.GetButtonDown("J_Reboot")) { gameManager.Restart(); } if (player.attacking) { player.Attack(); } if (ui.cooling) { ui.CooldownUpdate(); } }
public void OnClick() { player.Attack(); }
public void Attack() { player.AnimationPlay(2); player.Attack(); }
private void Attack(PlayerBehaviour player) { if ((Input.GetKey(KeyCode.Space) || Input.GetKey(KeyCode.Mouse0))) { player.Attack(); //Vector3 weaponSpawn = ship.transform.Find("WeaponSpawn").transform.position; //if (ship.GetComponent<Weapon>() != null) { // ship.GetComponent<Weapon>().Attack(ship.transform.up, weaponSpawn); //} //GameObject bullet = Instantiate(weapon, weaponSpawn, transform.rotation) as GameObject; //bullet.GetComponent<Rigidbody>().AddForce(Vector3.up * bulletSpeed * Time.deltaTime); //attackEnabled = false; //delay = fireRateDelay; } }