Merge branch 'particle-loop-fix' of https://github.com/Tryibion/FlaxEngine into Tryibion-particle-loop-fix
This commit is contained in:
@@ -284,6 +284,7 @@ void ParticleEffect::UpdateSimulation(bool singleFrame)
|
||||
void ParticleEffect::Play()
|
||||
{
|
||||
_isPlaying = true;
|
||||
_isStopped = false;
|
||||
}
|
||||
|
||||
void ParticleEffect::Pause()
|
||||
@@ -293,6 +294,7 @@ void ParticleEffect::Pause()
|
||||
|
||||
void ParticleEffect::Stop()
|
||||
{
|
||||
_isStopped = true;
|
||||
_isPlaying = false;
|
||||
ResetSimulation();
|
||||
}
|
||||
@@ -448,7 +450,7 @@ void ParticleEffect::Update()
|
||||
void ParticleEffect::UpdateExecuteInEditor()
|
||||
{
|
||||
// Auto-play in Editor
|
||||
if (!Editor::IsPlayMode)
|
||||
if (!Editor::IsPlayMode && !_isStopped)
|
||||
{
|
||||
_isPlaying = true;
|
||||
Update();
|
||||
|
||||
@@ -133,7 +133,7 @@ public:
|
||||
/// <summary>
|
||||
/// The particle system instance that plays the particles simulation in the game.
|
||||
/// </summary>
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Particle Effects\"), ActorToolbox(\"Visuals\")")
|
||||
API_CLASS(Attributes="ActorContextMenu(\"New/Visuals/Particle Effect\"), ActorToolbox(\"Visuals\")")
|
||||
class FLAXENGINE_API ParticleEffect : public Actor
|
||||
{
|
||||
DECLARE_SCENE_OBJECT(ParticleEffect);
|
||||
@@ -185,6 +185,7 @@ private:
|
||||
Array<ParticleEffectParameter> _parameters; // Cached for scripting API
|
||||
Array<ParameterOverride> _parametersOverrides; // Cached parameter modifications to be applied to the parameters
|
||||
bool _isPlaying = false;
|
||||
bool _isStopped = false;
|
||||
|
||||
public:
|
||||
/// <summary>
|
||||
|
||||
@@ -1318,6 +1318,8 @@ void ParticlesSystem::Job(int32 index)
|
||||
emitterInstance.Buffer = nullptr;
|
||||
}
|
||||
}
|
||||
// Stop playing effect.
|
||||
effect->Stop();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user