Z
Z
Zimaell2021-01-10 20:04:59
Unity
Zimaell, 2021-01-10 20:04:59

Why can't prefabs be initialized on the device?

I made initialization of levels from pictures and texts in the unit

int CountLevels = 30;
for(int lvl = 1; lvl < (CountLevels + 1); ++lvl){
            Levels[lvl] = Instantiate(levelPrefab, transform) as LevelPrefab;
            Levels[lvl].transform.SetParent(ContentScroll.transform);
            Levels[lvl].Level = lvl;
            }

I check everything works in the unit, they are displayed in the right place at any resolution, they are pressed, in general it works as it should, I upload it to the phone ... they are not there ...
and if I immediately put the prefab on the board, then you can see it on the phone, but here there are no instants and they are not on the phone, as it were incomprehensible ...
What could be?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
F
freeExec, 2021-01-10
@freeExec

For example raskolbas with scale. Why do you SetParent, why not immediately create where you need it?

D
Dima Pautov, 2017-04-11
@farcer

Everything is as simple as 2 fingers.
Let's go here , from the docks we take an example with a modal window. We create it. In this window we create markup.
Using the open callback, inside it, we initialize the slick sliders. Vertical and horizontal. Well, that's all. Further on your own

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question