Y
Y
Yugg02019-12-01 22:48:09
HTML
Yugg0, 2019-12-01 22:48:09

How to implement this function in Unity2D?

In my project there is an in-game store for items that need to be bought for game currency, so here's how I make it (currency), how do I make it so that if I get the currency at the game level, it will be credited to the menu (item store located in the main menu / main menu and the game level are different scenes). And how to implement so that the game currency is saved when restarting?
If I didn't say something clearly. Ask.

Answer the question

In order to leave comments, you need to log in

4 answer(s)
A
Abdula Magomedov, 2018-12-13
@Avarskiy

document.querySelector('box4'); // ошибка. Точку перед box4 поставь

document.querySelector('.box4'); // вот так

Y
Yusif Zourab, 2018-12-13
@iLegion

The property scrollHeightcannot benull

N
namee, 2019-12-02
@YugGO

You can’t do it yourself - use assets
https://assetstore.unity.com/packages/templates/sy...
- you can implement it through playerprefs,
- you can use static variables,
- you can do it normally and load part of the content only from the level (see dontdestroyonload )
- you can have an asset ready to use
the unity theme and it's beautiful that there are hundreds of millions of possibilities. You just need to figure out what is right for you and use it.

M
mopsicus, 2019-12-02
@mopsicus

I would not recommend storing any money-related data locally. Only on your server with verification of all transactions. Otherwise, all your domestic currency will immediately wind up, do not hesitate.
In addition, the second question immediately disappears: you can download data on the amount of internal currency (and everything else) on any screen, when you need it.
Even if you have an offline game, it's best not to store locally.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question