public void AddWeaponType(Tps_Weapon weapon) { playerInventory.AddWeapon(weapon); weaponText.text += (" " + (playerInventory.FindeWeaponIndex(weapon) + 1) + ": " + weapon.WeaponName); if (!playerInventory.HasWeapon(weapon)) { weaponContainer.Add(weapon); } }
private void OnTriggerEnter(Collider other) { if (other.gameObject == player) { AudioSource.PlayClipAtPoint(WeaponGrab, transform.position); if (!playerInventory.HasWeapon(this)) { controller.AddWeaponType(this); this.transform.parent = GameObject.FindGameObjectWithTag(Tags.weaponContainer).transform; this.transform.position = GameObject.FindGameObjectWithTag(Tags.weaponContainer).transform.position; this.gameObject.SetActive(false); } } }