using UnityEngine; public class WeaponPickup : PickupItem { [Header("Weapon Unlock Settings")] [SerializeField] private int weaponSlotIndex = 1; protected override bool CanCollect(GameObject player) { var weaponsController = player.GetComponent() ?? player.GetComponentInChildren(); return weaponsController != null; } protected override void ApplyPickupEffect(GameObject player) { var weaponsController = player.GetComponent() ?? player.GetComponentInChildren(); if (weaponsController != null) { weaponsController.EquipWeapon(weaponSlotIndex); } } }