private void Update()
{
if (this.m_CheckObjectIndex >= 0)
{
if (!ObjectSelector.isVisible)
{
SerializedProperty arrayElementAtIndex = this.m_SubEmitters.GetArrayElementAtIndex(this.m_CheckObjectIndex);
SerializedProperty serializedProperty = arrayElementAtIndex.FindPropertyRelative("emitter");
UnityEngine.Object objectReferenceValue = serializedProperty.objectReferenceValue;
ParticleSystem particleSystem = objectReferenceValue as ParticleSystem;
if (particleSystem != null)
{
bool flag = true;
if (this.ValidateSubemitter(particleSystem))
{
string text = ParticleSystemEditorUtils.CheckCircularReferences(particleSystem);
if (text.Length == 0)
{
if (!this.CheckIfChild(objectReferenceValue))
{
flag = false;
}
}
else
{
string message = string.Format("'{0}' could not be assigned as subemitter on '{1}' due to circular referencing!\nBacktrace: {2} \n\nReference will be removed.", particleSystem.gameObject.name, this.m_ParticleSystemUI.m_ParticleSystem.gameObject.name, text);
EditorUtility.DisplayDialog("Circular References Detected", message, "Ok");
flag = false;
}
}
else
{
flag = false;
}
if (!flag)
{
serializedProperty.objectReferenceValue = null;
this.m_ParticleSystemUI.ApplyProperties();
this.m_ParticleSystemUI.m_ParticleEffectUI.m_Owner.Repaint();
}
}
this.m_CheckObjectIndex = -1;
EditorApplication.update = (EditorApplication.CallbackFunction)Delegate.Remove(EditorApplication.update, new EditorApplication.CallbackFunction(this.Update));
}
}
}