Add play/pause widget and keybind for particles preview in asset Editor
This commit is contained in:
@@ -258,7 +258,7 @@ void ParticleEffect::ResetSimulation()
|
||||
Instance.ClearState();
|
||||
}
|
||||
|
||||
void ParticleEffect::UpdateSimulation()
|
||||
void ParticleEffect::UpdateSimulation(bool singleFrame)
|
||||
{
|
||||
// Skip if need to
|
||||
if (!IsActiveInHierarchy()
|
||||
@@ -270,6 +270,8 @@ void ParticleEffect::UpdateSimulation()
|
||||
// Request update
|
||||
_lastUpdateFrame = Engine::FrameCount;
|
||||
_lastMinDstSqr = MAX_Real;
|
||||
if (singleFrame)
|
||||
Instance.LastUpdateTime = (UseTimeScale ? Time::Update.Time : Time::Update.UnscaledTime).GetTotalSeconds();
|
||||
Particles::UpdateEffect(this);
|
||||
}
|
||||
|
||||
|
||||
@@ -334,7 +334,8 @@ public:
|
||||
/// <summary>
|
||||
/// Performs the full particles simulation update (postponed for the next particle manager update).
|
||||
/// </summary>
|
||||
API_FUNCTION() void UpdateSimulation();
|
||||
/// <param name="singleFrame">True if update animation by a single frame only (time time since last engine update), otherwise will update simulation with delta time since last update.</param>
|
||||
API_FUNCTION() void UpdateSimulation(bool singleFrame = false);
|
||||
|
||||
/// <summary>
|
||||
/// Updates the actor bounds.
|
||||
|
||||
Reference in New Issue
Block a user