// SPDX-FileCopyrightText: 2024 Unity Technologies and the glTFast authors // SPDX-License-Identifier: Apache-2.0 using System; using System.Threading; using System.Threading.Tasks; using Material = UnityEngine.Material; namespace GLTFast { /// /// Provides access to glTF materials. /// public interface IMaterialProvider : IMaterialsVariantsProvider { /// Task GetMaterialAsync(int index); /// /// Token to submit cancellation requests. The default value is None. Task GetMaterialAsync(int index, CancellationToken cancellationToken); /// Task GetDefaultMaterialAsync(); /// /// Token to submit cancellation requests. The default value is None. Task GetDefaultMaterialAsync(CancellationToken cancellationToken); /// /// Returns the material slots that correspond to the given MeshResult's sub-meshes. /// /// glTF mesh index. /// Per glTF mesh numeration. A glTF mesh is converted /// into one or more MeshResults which are numbered consecutively. /// Corresponding materials variants slots. /// /// IMaterialsVariantsSlot[] GetMaterialsVariantsSlots(int meshIndex, int meshNumeration); } }