Skip to content

Commit b80c3e6

Browse files
wmltogethermob-sakai
authored andcommitted
fix: (editor) sometimes crashes when entering play mode
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.
1 parent 6a1fef4 commit b80c3e6

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

Scripts/UIParticle.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -378,7 +378,7 @@ void ISerializationCallbackReceiver.OnAfterDeserialize()
378378
#if UNITY_EDITOR
379379
EditorApplication.delayCall += () =>
380380
{
381-
if (!this || !gameObject || !transform) return;
381+
if (!this || !gameObject || !transform || Application.isPlaying) return;
382382
transform.localScale = Vector3.one;
383383
m_ResetScaleOnEnable = false;
384384
EditorUtility.SetDirty(this);

0 commit comments

Comments
 (0)