// Update is called once per frame void Update() { if (!Grid.gameStateManager.editing && !Grid.gameStateManager.IsPaused) { if (EventSystem.current.currentSelectedGameObject == null) { if (Input.GetKeyDown(gunKeyCode)) { gun.shoot(shootForce, bc, rb); } } } }