Пример #1
0
    private void OnTriggerEnter(Collider other)
    {
        GrenadeThrow Grenade = grenade.GetComponent <GrenadeThrow>();

        if (other.CompareTag("Player") && isTriggerPickup && Grenade.currentGrenadeCount != Grenade.maxGrenadeCount)
        {
            TakeAmmo();
            AudioSource.PlayClipAtPoint(pickup, transform.position, volume);
        }
    }
Пример #2
0
    private void OnTriggerEnter(Collider other)
    {
        GrenadeThrow gt = other.GetComponent <GrenadeThrow>();

        if (gt != null)
        {
            gt.AddGrenade();
            gameObject.SetActive(false);
        }
    }
Пример #3
0
    void TakeAmmo()
    {
        GrenadeThrow Grenade = grenade.GetComponent <GrenadeThrow>();

        Grenade.currentGrenadeCount += quantity;
        if (Grenade.currentGrenadeCount > Grenade.maxGrenadeCount)
        {
            Grenade.currentGrenadeCount = Grenade.maxGrenadeCount;
        }
        Grenade.SetUI();
        Destroy(gameObject);
    }
Пример #4
0
 // Start is called before the first frame update
 void Start()
 {
     // 情報を持ってくる
     bomb = car.GetComponent <GrenadeThrow>();
 }
Пример #5
0
 // Start is called before the first frame update
 void Start()
 {
     bomb = car.GetComponent <GrenadeThrow>();
 }