/// <summary> /// WebPlayer、StandAloneではOggが対応。MOBILEはMP3が非対応なので、拡張子を入れ替える /// http://docs-jp.unity3d.com/Documentation/ScriptReference/WWW.GetAudioClip.html /// </summary> /// <param name="path">ファイルパス</param> /// <returns>対応するサウンドの拡張子を入れ替えたファイルパス</returns> public static string ChangeSoundExt(string path) { string ext = FilePathUtil.GetExtension(path).ToLower(); switch (ext) { case Ogg: if (!IsSupportOggPlatform()) { return(FilePathUtil.ChangeExtension(path, Mp3)); } break; case Mp3: if (IsSupportOggPlatform()) { return(FilePathUtil.ChangeExtension(path, Ogg)); } break; default: break; } return(path); }
public static string ChangeSoundExt(string path) { string str = FilePathUtil.GetExtension(path).ToLower(); if (str == null) { return(path); } if (!(str == ".ogg")) { if (str != ".mp3") { return(path); } } else { if (IsSupportOggPlatform()) { return(path); } return(FilePathUtil.ChangeExtension(path, ".mp3")); } if (!IsSupportOggPlatform()) { return(path); } return(FilePathUtil.ChangeExtension(path, ".ogg")); }
//アセットバンドル名を取得 string ToAssetBundleName(string rootPath, string assetPath) { string name; if (assetPath.StartsWith(rootPath)) { name = assetPath.Substring(rootPath.Length + 1); } else { name = FilePathUtil.GetFileName(assetPath); } return(FilePathUtil.ChangeExtension(name, ".asset")); }
//アセットバンドルの情報を取得 public AssetBundleInfo FindAssetBundleInfo(string path) { //ファイル情報を取得or作成 AssetBundleInfo info; //大文字と小文字を無視するDictionaryでアセットバンドルの小文字化に対応している if (!dictionary.TryGetValue(path, out info)) { string key = FilePathUtil.ChangeExtension(path, ".asset"); if (!dictionary.TryGetValue(key, out info)) { return(null); } } return(info); }
string GetPathChangedSoundExt(string path) { if (!loadLegacySoundExt) { return(""); } string ext = FilePathUtil.GetExtension(path); if (string.Compare(ext, ".ogg", true) == 0) { return(FilePathUtil.ChangeExtension(path, ".mp3")); } else if (string.Compare(ext, ".mp3", true) == 0) { return(FilePathUtil.ChangeExtension(path, ".ogg")); } return(""); }
public static void Write(string path, StringGridDictionary gridDictionary) { /* string ext = Path.GetExtension (path); * switch (ext) * { * case ExtXls: * book = new HSSFWorkbook(); * break; * case ExtXlsx: * book = new XSSFWorkbook(); * break; * default: * break; * } */ path = FilePathUtil.ChangeExtension(path, ExtXls); IWorkbook book = MakeBook(gridDictionary); using (FileStream fs = new FileStream(path, FileMode.OpenOrCreate, FileAccess.Write)) { book.Write(fs); } }