rokojori_action_library/Runtime/VFX/ParticleVFX/ParticleVFX.cs

72 lines
1.0 KiB
C#
Raw Normal View History

2026-10-05 19:25:04 +00:00
using Godot;
using System.Collections.Generic;
using Rokojori.Extensions;
namespace Rokojori;
[Tool]
[GlobalClass ]
public partial class ParticleVFX:Node3D
#if TOOLS
, GizmoDrawer
#endif
{
ParticleVFXPreset _preset;
[Export]
public ParticleVFXPreset preset
{
get => _preset;
set
{
_preset = value;
if ( _preset != null )
{
_preset.Initialize( this );
}
}
}
[Export]
public bool edit = false;
#if TOOLS
public override void _Process( double delta )
{
if ( preset == null )
{
return;
}
if ( edit )
{
preset.UpdateSettings( this );
}
UpdateGizmos();
}
public void DrawGizmo( EditorNode3DGizmoPlugin gizmoPlugin, EditorNode3DGizmo gizmo )
{
gizmo.Clear();
preset?.DrawGizmo( this, gizmoPlugin, gizmo );
}
#endif
protected ParticleVFXData _data;
public T GetDataAs<T>() where T:ParticleVFXData
{
return _data as T;
}
public void _SetParticlesVFXData( ParticleVFXData data )
{
_data = data;
}
}