private GameMapLevel CreateNewLevel(string name, int level) { GameMapLevel gml = Instantiate <GameMapLevel>(prototypeGameMapLevel, transform); gml.Init(level); gml.gameObject.name = name; levels.Add(gml); return(gml); }
private IEnumerator CreateLayers() { GameMapData gmap = GameMgmt.Get().data.map; //load layer levels = new List <GameMapLevel>(); for (int i = 0; i < gmap.levels.Count; i++) { GameMapLevel g = CreateNewLevel(gmap.levels[i].name, i); yield return(g.AddLayers()); } view.Init(); }