void Update() { movementController.Move(new Vector2(Input.GetAxis("Horizontal"), Input.GetAxis("Vertical"))); if (Input.GetButtonDown("Fire")) { Vector2 shotDirection = Input.mousePosition; shotDirection = Camera.main.ScreenToWorldPoint(shotDirection); shotDirection -= (Vector2)transform.position; shootingController.Fire(transform.position, shotDirection); } for (int i = 0; i < 4; i++) { if (Input.GetButtonDown("SelectWeapon" + (i + 1)) && (ShootingProjectiles[i].unlocked)) { shootingController.Initialize(GetComponentInChildren <IsometricCharacterRenderer>(), ShootingProjectiles[i]); } } }
public void FireButtonOnPress() { pb.Fire(); }