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 have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

In-game Character shop using coins collected in-game

Discussion in '2D' started by yuwakar, May 27, 2020.

  1. yuwakar

    yuwakar

    Joined:
    May 20, 2020
    Posts:
    1
    hi, i have a 2d game but i want to implement a system where you can collect coins which are stored and can be used to buy different characters in a shop, how would i implement this?
     
  2. SaoSilver

    SaoSilver

    Joined:
    May 27, 2020
    Posts:
    9
    1. Store an integer in a class for gold.
    2. Have a UI for the shop
    3. When clicking items in the shop, perform a condition (if class.GetGoldAmount > cost) and then do your logic: class.GetGoldAmount-=cost;
    //add character data to your player