Cleanup for Editor Play Mode#14
Conversation
| @@ -1,4 +1,4 @@ | |||
| #if UNITY_STANDALONE_WIN && UNITY_64 && !UNITY_EDITOR | |||
| #if UNITY_STANDALONE_WIN && UNITY_64 | |||
There was a problem hiding this comment.
The graphics init errors are coming from the #if NATIVE_RENDERING_PLUGIN_AVAILABLE (line 71 ) placeholder version of the NativeRenderingPluginNative class.
The solution is to not use the placeholder version in Play Mode.
| #endif | ||
| } | ||
|
|
||
| public virtual void Dispose() |
There was a problem hiding this comment.
This method can be made abstract. This class does not need to inherit IDisposable.
|
|
||
| public override void Dispose() | ||
| { | ||
| foreach (var (_, item) in m_Items) |
There was a problem hiding this comment.
Curious about why we need this. Doesn't the runtime clean up the textures when the game quits, or when entering play mode (domain reload).
There was a problem hiding this comment.
I have not encountered a need for this in any other projects I've seen.
…Unity into mark/enter-play-mode # Conflicts: # DisguiseUnityRenderStream/Runtime/ScratchTextureManager.cs
| } | ||
|
|
||
| public void Dispose() | ||
| protected override void Dispose() |
There was a problem hiding this comment.
This a workaround for NativeArray complaining about Dispose() not being called when you perform a domain reload, right? It's super-annoying.
Even if we don't support editor mode atm we can still expect the user to enter Play Mode for testing purposes.
Entering Play Mode before this PR shows a few errors. They're benign but look scary:

This PR would also make it easier to support editor mode in the future.