예제 #1
0
    public override void Interacting(Player player)
    {
        GunManager gm           = player.GetComponentInChildren <GunManager>();
        bool       alreadyOwned = false;

        foreach (Transform weapon in gm.transform)
        {
            Gun g = weapon.gameObject.GetComponent <Gun>();
            if ((g.modele == gunInShop.GetComponent <Gun>().modele) && g.isOwned)
            {
                alreadyOwned = true;
            }
        }
        if (!alreadyOwned)
        {
            if ((gm.nbGunsOwned == 2 && !gm.muleKick) || (gm.nbGunsOwned == 3 && gm.muleKick))
            {
                gm.DropGun();
            }
            AcheterGun(player);
            Destroy(this.transform.parent.gameObject);
        }
    }