예제 #1
0
 public void BuyCard(ShopCard item)
 {
     if (resources.GetValue(EResources.GOLD) >= item.price)
     {
         resources.AddResources(EResources.GOLD, -item.price);
         library.AddCard(item.card.Clone(), memoriesPile);
     }
 }
예제 #2
0
    /// <summary>
    /// Add a resource to the player's inventory
    /// </summary>
    /// <param name="type"> The resource's type </param>
    /// <param name="value"> The resource's quantity </param>
    void AddResourceToPlayerInv(ResourceType type, int value)
    {
        // Call the "AddResources" function in the ResourcesManager's script to add the resource to the player's inventory
        resourcesManagerScript.AddResources(type, value);

        // Call the "RemoveActualResource" function in the CharactersManager's script to remove the target on this resource
        charactersManagerScript.RemoveActualResource();

        // Destroy this GameObject (the resource)
        Destroy(this.gameObject);
    }