MeshSprites icon indicating copy to clipboard operation
MeshSprites copied to clipboard

Prefabs with MeshSprite create slowdown when selected in project browser (2019.4.28f1)

Open VoydVoyd opened this issue 4 years ago • 0 comments

In the project browser, when a prefab with an attached MeshSprite is selected but not yet opened, the preview in the project browser will rapidly refresh and flicker as the console is filled with the following warning:

SendMessage cannot be called during Awake, CheckConsistency, or OnValidate UnityEngine.StackTraceUtility:ExtractStackTrace () Valax321.MeshSprites.MeshSprite:GenerateMeshForSprite (UnityEngine.MeshFilter,UnityEngine.Sprite) (at Assets/Plugins/MeshSprites-1.0.0/Runtime/MeshSprite.cs:184) Valax321.MeshSprites.MeshSprite:OnValidate () (at Assets/Plugins/MeshSprites-1.0.0/Runtime/MeshSprite.cs:124) UnityEditor.EditorApplication:Internal_CallUpdateFunction

This occurs with enough frequency that the engine slows down, and clicking elsewhere to deselect the prefab takes several seconds to register. OnValidate seems to be called very rapidly (potentially every editor tick) while a prefab is selected - I'm not sure if this is regular behaviour, or because the MeshSprite script is causing the loop directly.

Potentially related to #3

VoydVoyd avatar Sep 28 '21 07:09 VoydVoyd