public void SaveMaybeOverwrite(SaveLoadController saveLoad, string id, GameBundle.Metadata metadata, Texture2D thumbnail, System.Action onSaveComplete) { string dir = GetBundleDirectory(id); Util.SetNormalFileAttributes(dir); Directory.CreateDirectory(dir); GameBundle bundle = new GameBundle(dir); if (thumbnail != null) { Util.SetNormalFileAttributes(bundle.GetThumbnailPath()); Util.SaveTextureToPng(thumbnail, bundle.GetThumbnailPath()); } Util.SetNormalFileAttributes(bundle.GetMetadataPath()); File.WriteAllText(bundle.GetMetadataPath(), JsonUtility.ToJson(metadata)); Util.SetNormalFileAttributes(bundle.GetVoosPath()); saveLoad.RequestSave(bundle.GetVoosPath(), onSaveComplete); #if !USE_STEAMWORKS workshop.Save(bundle.GetAssetsPath()); #endif }