rokojori_action_library/Runtime/VFX/LineVFX/LineMaterial/CustomLineMaterialPreset.cs

36 lines
773 B
C#
Raw Normal View History

2026-02-26 14:06:27 +00:00
using Godot;
using System.Collections.Generic;
namespace Rokojori;
[Tool,GlobalClass]
public partial class CustomLineMaterialPreset:LineMaterialPreset
{
[Export]
public Material material;
[Export]
public GeometryInstance3D.ShadowCastingSetting shadows = GeometryInstance3D.ShadowCastingSetting.On;
[Export]
public LineVFXShaderSetup shaderSetup;
public override void CreateMaterial( LineVFX lineVFX, MeshInstance3D mi )
{
mi.SetSurfaceOverrideMaterial( 0, material );
mi.CastShadow = shadows;
}
public override void SetPointData( LineVFX lineVFX, MeshInstance3D mi, LinePointData data, bool start )
{
if ( start )
{
shaderSetup.start.Set( mi, data );
}
else
{
shaderSetup.end.Set( mi, data );
}
}
}