private void OnTriggerExit(Collider other) { if (other.GetComponent <GunAtt>()) { if (collectableWeapons.Contains(other.transform)) { collectableWeapons.Remove(other.transform); } if (collectableWeapons.Count == 0) { BestPickable = null; } } if (other.GetComponent <SupplyBox>()) { CAmmoBag = null; } }
private void OnTriggerStay(Collider other) { if (((1 << other.gameObject.layer) & layerMask) != 0) { // Weapon checks if (other.GetComponent <GunAtt>()) { if (!collectableWeapons.Contains(other.transform)) { collectableWeapons.Add(other.transform); } } if (other.GetComponent <SupplyBox>()) { CAmmoBag = other.GetComponent <SupplyBox>(); } } }