38 lines
840 B
C#
38 lines
840 B
C#
using Godot;
|
|
using System.Collections.Generic;
|
|
|
|
using Rokojori.Extensions;
|
|
namespace Rokojori;
|
|
|
|
[Tool]
|
|
[GlobalClass ]
|
|
public abstract partial class ParticleVFXData:Resource
|
|
{
|
|
protected void UpdateCoreSettings( ParticleVFXPreset preset, GpuParticles3D particles )
|
|
{
|
|
if ( preset == null || particles == null )
|
|
{
|
|
return;
|
|
}
|
|
|
|
if ( particles.Amount != preset.maxParticles )
|
|
{
|
|
particles.Amount = preset.maxParticles;
|
|
}
|
|
|
|
if ( particles.AmountRatio != preset.maxParticlesAmount )
|
|
{
|
|
particles.AmountRatio = preset.maxParticlesAmount;
|
|
}
|
|
|
|
particles.Lifetime = preset.lifeTimeDuration;
|
|
particles.SpeedScale = preset.timeSpeed;
|
|
|
|
if ( particles.OneShot != preset.oneShot )
|
|
{
|
|
particles.OneShot = preset.oneShot;
|
|
}
|
|
|
|
particles.Explosiveness = preset.explosiveness;
|
|
}
|
|
} |