void Update() { if (m1m2Enabled) { if (Input.GetMouseButtonDown(0)) { if (item1 != null) { item1.attack(); } } if (Input.GetMouseButtonDown(1)) { if (item2 != null) { item2.attack(); } } } if (abilityEnabled) { if (Input.GetKeyDown(KeyCode.Q)) { if (ability1 != null) { ability1.attack(); } } } }