Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

GF repository?

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

  1. YourWaifu

    YourWaifu

    Joined:
    Oct 4, 2015
    Posts:
    43
    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

    Joined:
    Jan 20, 2016
    Posts:
    413
    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:
    43
    @erika_d,
    Change wallet balance type from long to decimal~
     
  4. erika_d

    erika_d

    Joined:
    Jan 20, 2016
    Posts:
    413
    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:
    35
    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.