Exemplo n.º 1
0
        private void CreateLoadSaved()
        {
            UISounds.Instance?.PlayOneShotSelectMajor();

            LoadSavedGameObject             = new GameObject();
            LoadSavedController             = LoadSavedGameObject.AddComponent <LoadSavedController>();
            LoadSavedController.SaveLoaded += () => SaveLoaded.Invoke();
            LoadSavedGameObject.SetActive(true);
        }
        public void LoadSave(LevelSaveData levelSave)
        {
            if (string.IsNullOrEmpty(levelSave.filePath) || !File.Exists(levelSave.filePath))
            {
                return;
            }
            if (levelSave.gameObjects == null || !levelSave.gameObjects.Any())
            {
                return;
            }

            SpawnableManager.DeleteSpawnedObjects();

            foreach (var savedGameObject in levelSave.gameObjects)
            {
                savedGameObject.Instantiate();
            }

            SaveLoaded?.Invoke();
        }
Exemplo n.º 3
0
 protected virtual void OnSaveLoaded(SaveLoadedEventArgs e)
 {
     SaveLoaded?.Invoke(this, e);
 }