public void Save() { if (m_fileStore != null) { // Backed by store m_fileStore.CreateDirectory(AssetPath.GetDirectoryName(m_savePath)); using (var stream = new StringWriter()) { Save(stream); m_fileStore.SaveTextFile(m_savePath, stream.ToString()); } } else { // Backed by filesystem Directory.CreateDirectory(Path.GetDirectoryName(m_savePath)); using (var stream = new StreamWriter(m_savePath)) { Save(stream); } } Modified = false; }
private static void LoadAsset(string path, bool reloadIfSourceUnchanged) { var extension = AssetPath.GetExtension(path); var type = LookupType(extension); if (type != null) { if (type.Compound) { var sources = new List <IAssetSource>(); for (int i = 0; i < s_assetSources.Count; ++i) { var source = s_assetSources[i]; if (source.CanLoad(path)) { sources.Add(source); } } if (sources.Count > 0) { LoadCompoundAsset(path, sources, reloadIfSourceUnchanged); } } else { for (int i = s_assetSources.Count - 1; i >= 0; --i) { var source = s_assetSources[i]; if (source.CanLoad(path)) { LoadBasicAsset(path, source, reloadIfSourceUnchanged); return; } } } } }
public Language(string path) { m_path = path; m_code = AssetPath.GetFileNameWithoutExtension(path); m_translations = new Dictionary <string, string>(); }
private string Resolve(string path) { return(AssetPath.Combine(m_rootPath, path)); }
public bool CanLoad(string path) { return (Assets.GetType(AssetPath.GetExtension(path)) != null && m_fileStore.FileExists(path)); }