コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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>();
                }
            }
        }