public Texture2D ImportTexture() { MegascansUtilities.CopyFileToProject(sourcePath, destPath); TextureImporter tImp = AssetImporter.GetAtPath(destPath) as TextureImporter; int importResolution = Convert.ToInt32(Math.Pow(2, 9 + EditorPrefs.GetInt("QuixelDefaultImportResolution", 4))); tImp.maxTextureSize = importResolution; tImp.sRGBTexture = sRGB; tImp.textureType = normalMap ? TextureImporterType.NormalMap : TextureImporterType.Default; AssetDatabase.ImportAsset(destPath); AssetDatabase.Refresh(); return(AssetDatabase.LoadAssetAtPath <Texture2D>(destPath)); }
static void ImportMesh(string sourcePath, string destPath) { MegascansUtilities.UpdateProgressBar(1.0f, "Importing Megascans Asset", "Importing Mesh..."); MegascansUtilities.CopyFileToProject(sourcePath, destPath); }