Skip to content

Commit

Permalink
fix: (editor) sometimes crashes when entering play mode
Browse files Browse the repository at this point in the history
If there are particle prefabs created using version 3.x in the project, there is a possibility that the editor may crash when entering Play Mode due to deserialization.
  • Loading branch information
wmltogether authored and mob-sakai committed Jan 18, 2024
1 parent 6a1fef4 commit b80c3e6
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 b80c3e6

Please sign in to comment.