Your scripts :
GameManager :
public class GameManager : MonoBehavior
{
public static GameObject character; // this field is to remember the selection. Since it is 'static', it will keep value in between scenes.
}
LevelManager :
public class LevelManager : MonoBehavior
{
public void Start()
{
// read info stored in GameManager
GameManager.character.transform.position = /* your start position */
}
}
In scene 1 (selection):
- store charcter selected in
GameManager.character
In scene 2 (level):
- An empty object with LevelManager script.
Note: Since we use static
, I'm actually unsure that you even need the GameManager script to be attached to an empty object, for both scenes.
In the selection scne, just make sure to assign the proper thing to character
(instance of Zelda or Megaman character prefab)