public static CarAsset CreateFromAudioZip(string filename) { CarAsset asset = new CarAsset(); using (FileStream zipFile = new FileStream(filename, FileMode.Open)) { using (ZipArchive zip = new ZipArchive(zipFile, ZipArchiveMode.Read)) { var settingsEntry = zip.GetEntry("settings.json"); CarSettings settings = null; if (settingsEntry == null) { settings = new CarSettings(); } else { settings = CarSettings.LoadFromZipEntry(settingsEntry); } asset.LoadSoundAssets(zip, settings); } } return(asset); }
public static CarAsset CreateFromPrefab(string filename) { CarAsset asset = new CarAsset(); asset.m_bundle = AssetBundle.LoadFromFile(filename); //nothing more to do on soundInfo return(asset); }