Ejemplo n.º 1
0
 public void OnUnequipButtonDown()
 {
     if (gunSlinger != null)
     {
         gunSlinger.Unequip();
     }
 }
Ejemplo n.º 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);
        }
    }