using System.Collections.Generic; using UnityEngine; using UnityEngine.SceneManagement; namespace Fungus { [System.Serializable] public class SavePointData { /// /// Version number of current save data format. /// protected const int SavePointDataVersion = 0; [SerializeField] protected int version; [SerializeField] protected string saveKey; [SerializeField] protected string description; [SerializeField] protected string sceneName; [SerializeField] protected List flowchartDatas = new List(); protected static SavePointData tempSavePointData; protected static void OnSceneLoaded(Scene scene, LoadSceneMode mode) { if (scene.name != tempSavePointData.SceneName) { return; } SceneManager.sceneLoaded -= OnSceneLoaded; var savePointData = tempSavePointData; for (int i = 0; i < savePointData.FlowchartDatas.Count; i++) { var flowchartData = savePointData.FlowchartDatas[i]; FlowchartData.Decode(flowchartData); } SavePointLoaded.NotifyEventHandlers(savePointData.saveKey); ExecuteBlocks(savePointData); } protected static void ExecuteBlocks(SavePointData savePointData) { // Execute any block containing a Label matching the save key var labels = Object.FindObjectsOfType