Skip to content

Commit

Permalink
Add #UNITY_2020_1_OR_NEWER wrapping to EditorUtility functions
Browse files Browse the repository at this point in the history
  • Loading branch information
yellowisher committed Nov 11, 2024
1 parent f0731a1 commit 0f8a977
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ public PrefabDirtyScope(GameObject prefab)
{
_prefab = prefab;

#if UNITY_EDITOR
#if UNITY_EDITOR && UNITY_2020_1_OR_NEWER
_madeDirty = prefab.activeSelf && !UnityEditor.EditorUtility.IsDirty(_prefab);
#endif
}

public void Dispose()
{
#if UNITY_EDITOR
#if UNITY_EDITOR && UNITY_2020_1_OR_NEWER
if (_madeDirty)
{
UnityEditor.EditorUtility.ClearDirty(_prefab);
Expand Down

0 comments on commit 0f8a977

Please sign in to comment.