Closed codymanix closed 2 years ago
Hey @codymanix, thanks for the PR.
Could you add a float layerDepth = 1
parameter to the other Trigger
method and use it within that method? I'm not sure why it's a value of 1
in the existing code, but I rather keep it the same behaviour as it was before for now.
Which other Trigger method do you mean?
The only literal "1" I can find in ParticleEmitter.cs is the one in the call to Release(line.Origin + offset, **1**)
, but it doesn't relate to the layerDepth but instead it is the argument for numToRelease:
public void Trigger(LineSegment line)
{
var numToRelease = _random.Next(Parameters.Quantity);
var lineVector = line.ToVector();
for (var i = 0; i < numToRelease; i++)
{
var offset = lineVector * _random.NextSingle();
Release(line.Origin + offset, **1**);
}
}
private void Release(Vector2 position, int numToRelease, float layerDepth = 0)
The layerDepth parameter I added did not change the default value, which was 0.
Ah shoot, yes, there is no third parameter on that line. I thought the 1
was for the third parameter. What I mean is to add layerDepth
parameter for the other Trigger
method and pass it along when calling Release
.
you mean additionally to the Trigger(Vector2 position, float layerDepth = 0)
method add layerDepth to public void Trigger(LineSegment line)
also?
Yes, for symmtery and completion.
Ok I completed the overloads now and pushed again.
I also saw, that some constructor arguments for ParticleEffect are not used (autoTrigger, autoTriggerDelay). Can I delete them?
public ParticleEffect(string name = null, bool autoTrigger = true, float autoTriggerDelay = 0f)
{
Name = name;
Emitters = new List<ParticleEmitter>();
}
yes
done.
for some reason the build failed. can one try to rerun the build?
Run dotnet nuget push "./**/*.nupkg" --source "MyGet" --skip-duplicate --api-key $MYGET_ACCESS_TOKEN
Specify --help for a list of available options and commands.
error: Missing value for option 'api-key'
That's expected; there is something wrong with pushing NuGet packages for a pull request.
Hi! I needed the ability to define the layerdepth also for autotriggered particleeffects so I've added this little feature, it was just a few lines and seems to work very well.
This is the first time I contribute something to any OS project, so please be lenient if I did something wrong.