feat(scripting): add mesh component script wrappers
This commit is contained in:
@@ -187,5 +187,41 @@ namespace XCEngine
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void Light_SetCastsShadows(ulong gameObjectUUID, bool value);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern string MeshFilter_GetMeshPath(ulong gameObjectUUID);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void MeshFilter_SetMeshPath(ulong gameObjectUUID, string path);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern int MeshRenderer_GetMaterialCount(ulong gameObjectUUID);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern string MeshRenderer_GetMaterialPath(ulong gameObjectUUID, int index);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void MeshRenderer_SetMaterialPath(ulong gameObjectUUID, int index, string path);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void MeshRenderer_ClearMaterials(ulong gameObjectUUID);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern bool MeshRenderer_GetCastShadows(ulong gameObjectUUID);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void MeshRenderer_SetCastShadows(ulong gameObjectUUID, bool value);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern bool MeshRenderer_GetReceiveShadows(ulong gameObjectUUID);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void MeshRenderer_SetReceiveShadows(ulong gameObjectUUID, bool value);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern int MeshRenderer_GetRenderLayer(ulong gameObjectUUID);
|
||||
|
||||
[MethodImpl(MethodImplOptions.InternalCall)]
|
||||
internal static extern void MeshRenderer_SetRenderLayer(ulong gameObjectUUID, int value);
|
||||
}
|
||||
}
|
||||
|
||||
22
managed/XCEngine.ScriptCore/MeshFilter.cs
Normal file
22
managed/XCEngine.ScriptCore/MeshFilter.cs
Normal file
@@ -0,0 +1,22 @@
|
||||
namespace XCEngine
|
||||
{
|
||||
public sealed class MeshFilter : Component
|
||||
{
|
||||
internal MeshFilter(ulong gameObjectUUID)
|
||||
: base(gameObjectUUID)
|
||||
{
|
||||
}
|
||||
|
||||
public string MeshPath
|
||||
{
|
||||
get => InternalCalls.MeshFilter_GetMeshPath(GameObjectUUID) ?? string.Empty;
|
||||
set => InternalCalls.MeshFilter_SetMeshPath(GameObjectUUID, value ?? string.Empty);
|
||||
}
|
||||
|
||||
public string meshPath
|
||||
{
|
||||
get => MeshPath;
|
||||
set => MeshPath = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
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