Skip to content

Commit

Permalink
Merge pull request #289 from wmltogether/fix-deserialize-crash
Browse files Browse the repository at this point in the history
Fix Editor sometimes crashes when entering Play Mode
  • Loading branch information
mob-sakai authored Jan 18, 2024
2 parents 6a1fef4 + b80c3e6 commit 86de8b6
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion Scripts/UIParticle.cs
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,7 @@ void ISerializationCallbackReceiver.OnAfterDeserialize()
#if UNITY_EDITOR
EditorApplication.delayCall += () =>
{
if (!this || !gameObject || !transform) return;
if (!this || !gameObject || !transform || Application.isPlaying) return;
transform.localScale = Vector3.one;
m_ResetScaleOnEnable = false;
EditorUtility.SetDirty(this);
Expand Down

0 comments on commit 86de8b6

Please sign in to comment.