Пример #1
0
    protected void OnEnterBulletBundle(TriggerVolume triggerVolume, Collider2D collision)
    {
        GunSlinger gunSlinger = collision.GetComponent <GunSlinger>();

        if (gunSlinger != null)
        {
            BulletBundle bulletBundle = triggerVolume.GetComponentInParent <BulletBundle>();
            Destroy(triggerVolume.gameObject);

            gunSlinger.AddBullet(new Gun.BulletInfo(bulletBundle.bulletPrefab, bulletBundle.num));
            Destroy(bulletBundle.gameObject);
        }
    }
Пример #2
0
    private void Awake()
    {
        m_bundle = transform.GetComponentInParent <BulletBundle>();

        m_worldObject = GetComponent <WorldObject>();
    }