Class ScyllaPlayModeReloadGuard
Holds script reloads back while the editor is in Play mode, so the running framework is not torn down by a recompile.
Inherited Members
Namespace: Scylla.Core.Editor
Assembly: ScyllaCore.Editor.dll
Syntax
[InitializeOnLoad]
public static class ScyllaPlayModeReloadGuard
Remarks
A domain reload during Play mode clears every static and then calls only
OnEnable on the scene's components. The bootstrap never runs again, so the
framework, its subsystems and every module stop working while Play mode carries on,
and nothing reports it.
When the editor preference Script Changes While Playing is set to Recompile And Continue Playing, which is Unity's default, the guard locks assembly reloads on entering Play mode and releases the lock on leaving it. Changed scripts are compiled and applied as soon as Play mode ends. The other two settings already avoid a reload during Play mode and are left alone.
Properties
IsLocked
Gets a value indicating whether the guard currently holds assembly reloads back.
Declaration
public static bool IsLocked { get; }
Property Value
| Type | Description |
|---|---|
| bool |