Files
AR-Menu/Library/PackageCache/com.needle.engine-exporter@8c046140a1d9/Gltf/Runtime/IGltfExtensionHandler.cs
2025-11-30 08:35:03 +02:00

32 lines
1.5 KiB
C#

using System.Collections.Generic;
using GLTF.Schema;
using UnityEngine;
namespace Needle.Engine.Gltf
{
/// <summary>
/// Implement to receive gltf export callbacks
/// </summary>
public interface IGltfExtensionHandler
{
void OnBeforeExport(GltfExportContext context);
bool OnBeforeNodeExport(GltfExportContext context, Transform transform);
// void OnBeforeNodeExport(GltfExportContext context, Transform transform);
void OnAfterNodeExport(GltfExportContext context, Transform transform, int nodeId);
void OnAfterExport(GltfExportContext context);
void OnBeforeMaterialExport(GltfExportContext context, Material material, int materialId);
void OnAfterMaterialExport(GltfExportContext context, Material material, int materialId);
void OnBeforeTextureExport(GltfExportContext context, ref TextureExportSettings settings, string textureSlot);
void OnAfterTextureExport(GltfExportContext context, int id, TextureExportSettings settings);
/// <summary>
/// Callback when serializing a mesh
/// </summary>
/// <param name="context"></param>
/// <param name="mesh"></param>
/// <param name="extensions">Add an instance of the extension to be added to the primitive</param>
void OnAfterPrimitiveExport(GltfExportContext context, Mesh mesh, List<object> extensions);
void OnAfterMeshExport(GltfExportContext currentContext, Mesh mesh, GLTFMesh gltfmesh, int index, List<object> extensions);
void OnExportFinished(GltfExportContext context);
void OnCleanup();
}
}