docs.unity3d.com
Search Results for

    Show / Hide Table of Contents

    Game Foundation Tutorials

    Creating a Currency

    You may want to deal with a collectable resource, but don't need to identify each instance of the resource. The most obvious example of this kind of resource is money. You don't need to give an identity to each coin in your wallet, and you'd need to collect thousands, millions of them.

    A Currency is the type of catalog item you need.

    Open the Currency Window

    In order to create a Currency, you need to open the Currency Window. Open the Currency Window by selecting Window → Game Foundation → Currency.
    You will see the following window.

    Access the Currency Window

    As you can you can see, the layout is similar to the Inventory window, with the Currency tab, and a Categories tab.

    Create a new currency

    Similar to the Item Definition tutorial, clicking on the + button at the bottom of the left section shows the id field, the display name field and the Create button in the section on the right.

    The specific fields of the Currency Editor

    After creation, the editor shows some currency specific fields:

    • Initial allocation is the amount of this currency a new player can have.
    • Maximum allocation is the limit of this currency the player can possess. 0 means no limit.
    • The type of this currency can be soft, or hard. This property doesn't change the way the currency is handled by Game Foundation, but it helps you organize your data.

    Apart from those specific fields, a currency has the same features as an inventory item definition.

    With this currency created, we now can switch back to the code with the next tutorial.

    In This Article
    Back to top
    Copyright © 2024 Unity Technologies — Trademarks and terms of use
    • Legal
    • Privacy Policy
    • Cookie Policy
    • Do Not Sell or Share My Personal Information
    • Your Privacy Choices (Cookie Settings)