Exemplo n.º 1
0
        public void SaveMap()
        {
            if (CurrentMap == null)
            {
                return;
            }

            SaveLoadMap.Save(CurrentMap);
        }
Exemplo n.º 2
0
        public void LoadMaps()
        {
            MapList = SaveLoadMap.LoadAll();

            //destroy previous
            List <GameObject> removeList = new List <GameObject>();

            foreach (Transform child in MapSaveParent.transform)
            {
                removeList.Add(child.gameObject);
            }
            for (int i = removeList.Count - 1; i >= 0; i--)
            {
                Destroy(removeList[i]);
            }

            foreach (Map map in MapList)
            {
                GameObject go = Instantiate(MapSavePrefab, MapSaveParent.transform);
                go.GetComponent <MapSaveController>().Set(map);
            }
        }