Skip to content

Commit

Permalink
Fixed deprecated warning in Unity 2022.2.
Browse files Browse the repository at this point in the history
  • Loading branch information
nmalg committed Oct 12, 2022
1 parent 5bef842 commit a63ec4c
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions Editor/AGXUnityEditor/Manager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -627,9 +627,15 @@ public static void UpdateMouseOverPrimitives( Event current, bool forced = false
private static void OnHierarchyWindowChanged()
{
var scene = EditorSceneManager.GetActiveScene();
var currNumScenesLoaded =
#if UNITY_2022_2_OR_NEWER
UnityEngine.SceneManagement.SceneManager.loadedSceneCount;
#else
EditorSceneManager.loadedSceneCount;
#endif
var isSceneLoaded = scene.name != m_currentSceneName ||
// Drag drop of scene into hierarchy.
EditorSceneManager.loadedSceneCount > m_numScenesLoaded;
currNumScenesLoaded > m_numScenesLoaded;

if ( isSceneLoaded ) {
EditorData.Instance.GC();
Expand All @@ -639,7 +645,7 @@ private static void OnHierarchyWindowChanged()
AutoUpdateSceneHandler.HandleUpdates( scene );
}

m_numScenesLoaded = EditorSceneManager.loadedSceneCount;
m_numScenesLoaded = currNumScenesLoaded;
}

/// <summary>
Expand Down

0 comments on commit a63ec4c

Please sign in to comment.