static FrameCapturerPackagerInternal() // auto extracts { if (AutoExtractAllowed && FrameCapturerPresent) { m_PkgFile = Path.Combine(FRPackagerPaths.GetIntegrationPackagePath(), k_PackageName + ".unityPackage"); m_ScriptFile = Path.Combine(FRPackagerPaths.GetIntegrationPath(), "FrameCapturer/Recorders/BaseFCRecorderSettings.cs"); if (File.Exists(m_PkgFile) && (!File.Exists(m_ScriptFile) || File.GetLastWriteTime(m_PkgFile) > File.GetLastWriteTime(m_ScriptFile))) { Debug.Log("Importing FrameCapturer's Recorders: Processing..."); AssetDatabase.importPackageCompleted += AssetDatabase_importPackageCompleted; AssetDatabase.importPackageFailed += AssetDatabase_importPackageFailed; AssetDatabase.importPackageCancelled += RemovePackageImportCallbacks; AssetDatabase.ImportPackage(m_PkgFile, false); } } }
public static string GeneratePackage() { string[] files = new string[] { Path.Combine(FRPackagerPaths.GetIntegrationPath(), "FrameCapturer/Recorders"), }; var destDir = FRPackagerPaths.GetIntegrationPackagePath(); if (!Directory.Exists(destDir)) { Directory.CreateDirectory(destDir); } var destFile = Path.Combine(destDir, k_PackageName + ".unitypackage"); AssetDatabase.ExportPackage(files, destFile, ExportPackageOptions.Recurse); Debug.Log("Generated package: " + destFile); return(destFile); }