render

Material

RegisterMaterial MaterialChangerAuthoring.cs

World.GetOrCreateSystemManaged<EntitiesGraphicsSystem>().RegisterMaterial(material);

mmi.MaterialID = m_MaterialMapping[material];

MaterialMeshInfo.MaterialID = BatchMaterialID;

RegisterBinding

[RegisterBinding(typeof(MaterialChanger), "frequency")]

为 Entity 添加渲染组件

AddComponentsExample.cs

RenderMeshUtility.AddComponents(  
    entity,  
    entityManager,  
    desc,  
    renderMeshArray,  
    MaterialMeshInfo.FromRenderMeshArrayIndices(0, 0));
[WorldSystemFilter(WorldSystemFilterFlags.BakingSystem)]

最后更新于