示例#1
0
    public void Save()
    {
        // If we're using caching and we've not already cached this file, cache it.
        if (settings.location == ES3.Location.Cache && !ES3.FileExists(settings))
        {
            ES3.CacheFile(settings);
        }

        if (autoSaves == null || autoSaves.Count == 0)
        {
            ES3.DeleteKey(key, settings);
        }
        else
        {
            var gameObjects = new List <GameObject>();
            foreach (var autoSave in autoSaves)
            {
                // If the ES3AutoSave component is disabled, don't save it.
                if (autoSave.enabled)
                {
                    gameObjects.Add(autoSave.gameObject);
                }
            }
            ES3.Save <GameObject[]>(key, gameObjects.ToArray(), settings);
        }

        if (settings.location == ES3.Location.Cache && ES3.FileExists(settings))
        {
            ES3.StoreCachedFile(settings);
        }
    }
示例#2
0
 public override void Enter()
 {
     ES3.StoreCachedFile(filePath.Value, GetSettings());
 }