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); } }
private void Awake() { m_bundle = transform.GetComponentInParent <BulletBundle>(); m_worldObject = GetComponent <WorldObject>(); }