Z
Z
Zimaell2021-01-20 11:49:34
Unity
Zimaell, 2021-01-20 11:49:34

How to make a prefab storage?

Let's say I have a game with several sublevels and levels, each level has 3 stars, and that each level looks like this

SubLevel = 1;
Level = 1;
LevelOpen = false;
Star1 = false;
Star2 = false;
Star3 = false;

as you progress through the passage, of course, the level opens LevelOpen = true;, and some stars open depending on the conditions. Of course, all this data must be stored somewhere.
How to make a prefab in which they will be stored, or tell me how best to do this?
I still have one idea in mind - to store in a line in PlayerPrefs, something like this
1,1,0,0,0,0|1,2,0,0,0,0|1,3,0,0,0,0....

Well, then split into | and on to get the data, and then change and write, but it might somehow be more correct ...

Answer the question

In order to leave comments, you need to log in

1 answer(s)
G
GavriKos, 2021-01-20
@Zimaell

Use json Luke. And it's moeno to shove it into the player, yes.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question