public void ApplyProperties()
{
bool hasModifiedProperties = m_ParticleSystemSerializedObject.hasModifiedProperties;
// Check the system was not destroyed such as by an Undo operation.
if (m_ParticleSystemSerializedObject.targetObject != null)
{
m_ParticleSystemSerializedObject.ApplyModifiedProperties();
}
if (hasModifiedProperties)
{
// Resimulate
foreach (ParticleSystem ps in m_ParticleSystems)
{
ParticleSystem root = ParticleSystemEditorUtils.GetRoot(ps);
if (!ParticleEffectUI.IsStopped(root) && ParticleSystemEditorUtils.resimulation)
{
ParticleSystemEditorUtils.PerformCompleteResimulation();
}
}
// Refresh procedural supported string
UpdateParticleSystemInfoString();
}
if (m_RendererSerializedObject != null && m_RendererSerializedObject.targetObject != null)
{
m_RendererSerializedObject.ApplyModifiedProperties();
}
}