Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We are updating our Terms of Service for all Unity subscription plans, effective October 13, 2022, to create a more streamlined, user-friendly set of terms. Please review them here: unity.com/legal/terms-of-service.
    Dismiss Notice
  3. Have a look at our Games Focus blog post series which will show what Unity is doing for all game developers – now, next year, and in the future.
    Dismiss Notice

GF repository?

Discussion in 'Game Foundation' started by YourWaifu, Oct 5, 2020.

  1. YourWaifu

    YourWaifu

    Joined:
    Oct 4, 2015
    Posts:
    24
    Hey, do you plan to open sources in a public repository?

    I need to make some changes to the API of wallets and would like to fork the repository~


    Thanks.
     
  2. erika_d

    erika_d

    Unity Technologies

    Joined:
    Jan 20, 2016
    Posts:
    411
    Hi @YourWaifu,

    Thanks for your interest in Game Foundation and the Wallet system. Unfortunately I'm not aware of any current plans to open source the repository. I'm curious though what sort of changes you're interested in making to the wallet API? Maybe I can help brainstorm other ways the existing Wallet system can meet your needs, or can add them to our list of feature requests?
     
  3. YourWaifu

    YourWaifu

    Joined:
    Oct 4, 2015
    Posts:
    24
    @erika_d,
    Change wallet balance type from long to decimal~
     
  4. erika_d

    erika_d

    Unity Technologies

    Joined:
    Jan 20, 2016
    Posts:
    411
    Thanks for that info @YourWaifu! As a potential workaround could you keep the value in long, and then divide by 100 (or whatever gives the number of decimal places you want) when displaying the value to users? (i.e 1032 becomes 10.32) That had sorta been our thinking when we decided to go with storing currency as longs.
     
  5. tony_c-unity3d

    tony_c-unity3d

    Unity Technologies

    Joined:
    Jul 18, 2019
    Posts:
    33
    Great idea @erika_d! Another workaround might be to use 2 currencies to encode both the whole number and the decimal portion as separate values, assuming you need more accuracy and/or larger numbers. ex: Currency: "coins" and currency: "coins_dec" could be used together to determine the final total of coins with high precision. Erika's solution is much easier to use and likely covers your use case @YourWaifu, but in case you needed functionality closer to that of decimal, perhaps 2 longs would suffice.

    Best of luck and please let us know if you have any other questions.
     
    erika_d likes this.
unityunity