// Returns true if overrides count changed during the update
        public bool MoveNext()
        {
            if (IsDone())
            {
                return(false);
            }

            var assetRoot  = m_PrefabAssetRoots[m_CurrentAssetIndex];
            var startCount = m_OverridesCount[m_CurrentAssetIndex];

            switch (m_CurrentStep)
            {
            case 0:
            {
                // First check if we have cached overides count for the prefab
                var path = AssetDatabase.GetAssetPath(assetRoot);
                var guid = AssetDatabase.AssetPathToGUID(path);
                var cachedPrefabAssetInfo = PrefabAssetStateCache.GetState(guid);
                if (cachedPrefabAssetInfo != null)
                {
                    m_OverridesCount[m_CurrentAssetIndex] = cachedPrefabAssetInfo.overrideCount;
                    m_ChangedCount = true;
                    m_CurrentAssetIndex++;
                    if (m_Debug)
                    {
                        Debug.Log($"[OverridesCounterForPrefabAssets] Using cached overridecount {cachedPrefabAssetInfo.overrideCount} ({path})");
                    }
                    return(true);
                }
            }
            break;

            case 1:
                PropertyModification[] mods = PrefabUtility.GetPropertyModifications(assetRoot);
                foreach (PropertyModification mod in mods)
                {
                    if (mod.target == null)
                    {
                        continue;
                    }

                    if (!PrefabUtility.IsDefaultOverride(mod))
                    {
                        m_OverridesCount[m_CurrentAssetIndex]++;
                    }
                }
                break;

            case 2:
                m_OverridesCount[m_CurrentAssetIndex] += PrefabOverridesUtility.GetAddedComponents(assetRoot).Count;
                break;

            case 3:
                m_OverridesCount[m_CurrentAssetIndex] += PrefabOverridesUtility.GetRemovedComponents(assetRoot).Count;
                break;

            case 4:
                m_OverridesCount[m_CurrentAssetIndex] += PrefabOverridesUtility.GetAddedGameObjects(assetRoot).Count;
                break;

            default:
            {
                // Cache result
                var path            = AssetDatabase.GetAssetPath(assetRoot);
                var guid            = AssetDatabase.AssetPathToGUID(path);
                var prefabAssetInfo = new PrefabAssetInfo();
                prefabAssetInfo.overrideCount  = m_OverridesCount[m_CurrentAssetIndex];
                prefabAssetInfo.prefabFileHash = AssetDatabase.GetSourceAssetFileHash(guid);
                PrefabAssetStateCache.SetState(guid, prefabAssetInfo);
                if (m_Debug)
                {
                    Debug.Log($"[OverridesCounterForPrefabAssets] Set cached overridecount {prefabAssetInfo.overrideCount} for {path}");
                }

                // Move to next asset
                m_CurrentAssetIndex++;
                m_CurrentStep = 0;
            }
            break;
            }

            if (m_Debug)
            {
                Debug.Log($"[OverridesCounterForPrefabAssets] Current asset index: {m_CurrentAssetIndex}, current step: {m_CurrentStep}");
            }

            m_CurrentStep++;

            // Simulate heavy calculation
            if (m_Debug)
            {
                System.Threading.Thread.Sleep(500);
            }

            m_ChangedCount = m_OverridesCount[m_CurrentAssetIndex] != startCount;

            return(true);
        }