feat(scripting): add mesh component script wrappers
This commit is contained in:
64
managed/XCEngine.ScriptCore/MeshRenderer.cs
Normal file
64
managed/XCEngine.ScriptCore/MeshRenderer.cs
Normal 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);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user