feat(scripting): add mesh component script wrappers

This commit is contained in:
2026-03-27 14:52:00 +08:00
parent 2b0df52446
commit bea849646f
12 changed files with 448 additions and 8 deletions

View File

@@ -0,0 +1,64 @@
namespace XCEngine
{
public sealed class MeshRenderer : Component
{
internal MeshRenderer(ulong gameObjectUUID)
: base(gameObjectUUID)
{
}
public int MaterialCount => InternalCalls.MeshRenderer_GetMaterialCount(GameObjectUUID);
public int materialCount => MaterialCount;
public bool CastShadows
{
get => InternalCalls.MeshRenderer_GetCastShadows(GameObjectUUID);
set => InternalCalls.MeshRenderer_SetCastShadows(GameObjectUUID, value);
}
public bool castShadows
{
get => CastShadows;
set => CastShadows = value;
}
public bool ReceiveShadows
{
get => InternalCalls.MeshRenderer_GetReceiveShadows(GameObjectUUID);
set => InternalCalls.MeshRenderer_SetReceiveShadows(GameObjectUUID, value);
}
public bool receiveShadows
{
get => ReceiveShadows;
set => ReceiveShadows = value;
}
public int RenderLayer
{
get => InternalCalls.MeshRenderer_GetRenderLayer(GameObjectUUID);
set => InternalCalls.MeshRenderer_SetRenderLayer(GameObjectUUID, value);
}
public int renderLayer
{
get => RenderLayer;
set => RenderLayer = value;
}
public string GetMaterialPath(int index)
{
return InternalCalls.MeshRenderer_GetMaterialPath(GameObjectUUID, index) ?? string.Empty;
}
public void SetMaterialPath(int index, string path)
{
InternalCalls.MeshRenderer_SetMaterialPath(GameObjectUUID, index, path ?? string.Empty);
}
public void ClearMaterials()
{
InternalCalls.MeshRenderer_ClearMaterials(GameObjectUUID);
}
}
}