Exemplo n.º 1
0
        /// <summary>
        /// Loads the state of the passed save data without loading the scene it's registered with.
        /// </summary>
        public virtual void LoadState(GameSaveData saveData)
        {
            if (!string.IsNullOrEmpty(saveData.ProgressMarkerKey))
            {
                ProgressMarker.latestExecuted = ProgressMarker.FindWithKey(saveData.ProgressMarkerKey);
            }
            // ^ In case any to-be-reexecuted blocks need to know

            // Have each subloader go through the items one at a time, loading as many of them
            // as they can.

            for (int i = 0; i < subloaders.Count; i++)
            {
                var loader = subloaders[i];

                if (loader == null)
                {
                    Debug.LogWarning(this.name + " has a null subloader registered under it.");
                    continue;
                }

                for (int j = 0; j < saveData.Items.Count; j++)
                {
                    var saveItem = saveData.Items[j];
                    loader.Load(saveItem);
                }
            }
        }
 public override void OnEnter()
 {
     base.OnEnter();
     latestExecuted = this;
     Continue();
 }