Beispiel #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);
        }
    }
Beispiel #2
0
    protected void OnEnterGun(TriggerVolume triggerVolume, Collider2D collision)
    {
        GunSlinger gunSlinger = collision.GetComponent <GunSlinger>();

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

            if (gunSlinger.EquippedGun != null)
            {
                gunSlinger.EquippedGun.RuleManager.overridedGameRule = null;
                gunSlinger.Unequip();
            }

            gunSlinger.Equip(gun);
        }
    }