Add option to disable particles preview in scene view and play only looping effects

#1767
This commit is contained in:
Wojtek Figat
2024-06-11 11:37:49 +02:00
parent 4dabf4bf01
commit 5b71591998
5 changed files with 17 additions and 1 deletions

View File

@@ -446,15 +446,21 @@ void ParticleEffect::Update()
#if USE_EDITOR
#include "Editor/Editor.h"
#include "Editor/Managed/ManagedEditor.h"
void ParticleEffect::UpdateExecuteInEditor()
{
// Auto-play in Editor
if (!Editor::IsPlayMode && !_isStopped)
if (!Editor::IsPlayMode && !_isStopped && IsLooping && PlayOnStart && Editor::Managed->ManagedEditorOptions.EnableParticlesPreview)
{
_isPlaying = true;
Update();
}
else if (!Editor::IsPlayMode && _isPlaying)
{
_isPlaying = false;
ResetSimulation();
}
}
#endif