// Update is called once per frame void Update() { if (Input.GetMouseButton(0)) { if (gun != null) { gun.Attack(); } if (gun2 != null) { gun2.Attack(); } } //临时代码 if (Input.GetKeyDown(KeyCode.R)) { if (gun != null) { gun.newReload(); } if (gun2 != null) { gun2.newReload(); } } }