void OnTriggerEnter(Collider collider) { if (collider.gameObject.tag == "Cowboy") { GunSpawn.RemoveIndicator(myTransform); Destroy(gameObject); } }
private void DestroyAllGuns() { GameObject[] guns = GameObject.FindGameObjectsWithTag("Gun"); for (int i = 0; i < guns.Length; i++) { Destroy(guns[i]); GunSpawn.RemoveIndicator(guns[i].GetComponent <GunPickupDestroyer>().myTransform); } }