mob-sakai / SoftMaskForUGUI

Enhance Unity UI (uGUI) with advanced soft-masking features to create more visually appealing effects!
https://github.com/mob-sakai/SoftMaskForUGUI
MIT License
2.08k stars 269 forks source link

Prefab Mode in Play Mode is not supported #60

Closed strawlink closed 5 years ago

strawlink commented 5 years ago

Describe the bug The following message appears when entering play mode while having a prefab open. The prefab edit mode is then stopped and you're thrown back to the scene.

Prefab Mode in Play Mode was blocked by the script 'SoftMaskable' to prevent the script accidentally affecting Play Mode. See the documentation for [ExecuteInEditMode] and [ExecuteAlways] for info on how to make scripts compatible with Prefab Mode during Play Mode.
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)

To Reproduce

  1. Create a prefab.
  2. Add the SoftMaskable script to any object inside it.
  3. Open the prefab in prefab editing mode.
  4. Start Play-mode.
  5. Observe that prefab editing mode is stopped.

Environment (please complete the following information):

Additional context By changing the ExecuteInEditMode attribute to ExecuteAlways, the warning is removed and the Prefab Edit mode stays open - I do not know if there are any unintentional changes due to this, so I figured it was best to make a bug report.

mob-sakai commented 5 years ago

Hi @strawlink Thank you for your reporting!

AlexD182 commented 2 years ago

Repeated in Unity 2020.3.30f1