remove GLTF plugin, bug fix

This commit is contained in:
CroakFang
2023-06-30 08:28:36 +08:00
parent 36d037f0a3
commit 7fb0a48996
534 changed files with 70 additions and 78609 deletions
+3 -28
View File
@@ -2,38 +2,13 @@ using System.Collections;
using System.Collections.Generic;
using System.Runtime.Serialization;
using UnityEngine;
using UnityGLTF;
//using UnityGLTF;
public class ModelExporter
{
public static string RetrieveTexturePath(UnityEngine.Texture texture)
public static void exportModel(string path,GameObject gameobj)
{
string m_Path = Application.dataPath;
var path = m_Path + "/../unknown/" + texture.name; ;
return path;
}
public static void Export(Transform[] transforms, string sceneName)
{
var exportOptions = new UnityGLTF.ExportOptions { TexturePathRetriever = RetrieveTexturePath };
var exporter = new GLTFSceneExporter(transforms, exportOptions);
string m_Path = Application.dataPath;
string path = m_Path + "/../Exported/" + sceneName;
var resultFile = GLTFSceneExporter.GetFileName(path, sceneName, ".gltf");
exporter.SaveGLTFandBin(path, sceneName);
}
public static void exportModel(GameObject gameobj)
{
string sceneName = gameobj.name;
Transform[] rootTransforms = new Transform[] { gameobj.transform };
Export(rootTransforms, sceneName);
//Todo Export PmX
}
}