36 lines
773 B
C#
36 lines
773 B
C#
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 );
|
|
}
|
|
}
|
|
}
|