using System.Collections.Generic; using GLTF.Schema; using UnityEngine; namespace Needle.Engine.Gltf { /// /// Base implementation for convenient selective override /// public abstract class GltfExtensionHandlerBase : IGltfExtensionHandler { public virtual void OnBeforeExport(GltfExportContext context) { } public virtual bool OnBeforeNodeExport(GltfExportContext context, Transform transform) { return true; } // public void OnBeforeNodeExport(GltfExportContext context, Transform transform) // { // // } public virtual void OnAfterNodeExport(GltfExportContext context, Transform transform, int nodeId) { } public virtual void OnBeforeMaterialExport(GltfExportContext context, Material material, int materialId) { } public virtual void OnAfterMaterialExport(GltfExportContext context, Material material, int materialId) { } public virtual void OnBeforeTextureExport(GltfExportContext context, ref TextureExportSettings settings, string textureSlot) { } public virtual void OnAfterTextureExport(GltfExportContext context, int id, TextureExportSettings settings) { } public virtual void OnAfterPrimitiveExport(GltfExportContext context, Mesh mesh, List extensions) { } public virtual void OnAfterMeshExport(GltfExportContext currentContext, Mesh mesh, GLTFMesh gltfmesh, int index, List extensions) { } /// /// Is called before serialize /// /// public virtual void OnAfterExport(GltfExportContext context) { } /// /// Is called when all export has been completed /// /// public virtual void OnExportFinished(GltfExportContext context) { } public virtual void OnCleanup() { } } }