Skip to content

Commit 8469db6

Browse files
committed
Use newer apis where available, so upm doesn't complain about dirty logs on import
1 parent 63d6662 commit 8469db6

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/com.unity.git.ui/UI/ApplicationManager.cs

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,8 +52,15 @@ protected override void InitializationComplete()
5252
private void ListenToUnityExit()
5353
{
5454
EditorApplicationQuit = (UnityAction)Delegate.Combine(EditorApplicationQuit, new UnityAction(Dispose));
55+
56+
// clean up when entering play mode
57+
#if UNITY_2017_2_OR_NEWER
58+
EditorApplication.playModeStateChanged += change => {
59+
if (change == PlayModeStateChange.EnteredPlayMode)
60+
#else
5561
EditorApplication.playmodeStateChanged += () => {
5662
if (EditorApplication.isPlayingOrWillChangePlaymode && !EditorApplication.isPlaying)
63+
#endif
5764
{
5865
Dispose();
5966
}

0 commit comments

Comments
 (0)