- Home /
New UI Map Selection
Hello
I am trying to make a map selection, I've never done it before so I don't have a 100% understanding of how to do it. What I tried is this code which works but I am not sure how efficient is to instantiate a ui.
A second problem is that I have a button attached to the panel which once is made into a prefab the OnClick function in the inspector can't detect any GameObjects and if I select the scripts that has the function in it the only function that will be displayed is "MonoScript->String Name"
Also I am using Bolt instead of the default networking system.
void Awake()
{
foreach (string maps in BoltScenes.AllScenes)
{
if (Application.loadedLevelName != maps)
{
(Instantiate(mapsPrefab, new Vector2(0, 0), Quaternion.identity) as Transform).transform.SetParent(this.gameObject.transform,false);
}
}
}
For future reference you'll get better answers if you separate your questions out into different posts.
Check out my tutorial series on the UI. Either the drop down menu or the concept art display could be easily adapted for using with level selection.
Your answer
Follow this Question
Related Questions
A node in a childnode? 1 Answer
Issue Instantiating prefab in C# 0 Answers
How to make an instantiated enemy to translate to a point first and then to lookAt the player ??? 2 Answers
How to define directions of a spawned object? 0 Answers
Multiple instances of static mesh increase size of game build 1 Answer