Assets/_Scripts/Others/RevertAllPrefabs.cs
/// <summary>
/// This keeps us from reverting the same prefab over and over, which otherwise happens when we're doing checks for nested prefabs.
/// </summary>
This keeps us from reverting the same prefab over and over, which otherwise happens when we're doing checks for nested prefabs.
This keeps us from reverting the same prefab over and over which otherwise happens when we ' re doing checks for nested prefabs .
static bool IsAPrefabNotYetReverted( GameObject obj, ref Dictionary<UnityEngine.Object, bool> prefabsAlreadyReverted )
    {
        bool wasValidAtEitherLevel = false;
        UnityEngine.Object prefab = PrefabUtility.GetPrefabParent( obj );
        if ( prefab != null && !prefabsAlreadyReverted.ContainsKey( prefab ) )
        {
            wasValidAtEitherLevel = true;
            prefabsAlreadyReverted[prefab] = true;
        }
        prefab = PrefabUtility.GetPrefabObject( obj );
        if ( prefab != null && !prefabsAlreadyReverted.ContainsKey( prefab ) )
        {
            wasValidAtEitherLevel = true;
            prefabsAlreadyReverted[prefab] = true;
        }
        return wasValidAtEitherLevel;
    }
static bool IsAPrefabNotYetReverted ( GameObject obj , ref Dictionary < UnityEngine . Object , bool > prefabsAlreadyReverted ) { bool wasValidAtEitherLevel = false ; UnityEngine . Object prefab = PrefabUtility . GetPrefabParent ( obj ) ; if ( prefab != null && ! prefabsAlreadyReverted . ContainsKey ( prefab ) ) { wasValidAtEitherLevel = true ; prefabsAlreadyReverted [ prefab ] = true ; } prefab = PrefabUtility . GetPrefabObject ( obj ) ; if ( prefab != null && ! prefabsAlreadyReverted . ContainsKey ( prefab ) ) { wasValidAtEitherLevel = true ; prefabsAlreadyReverted [ prefab ] = true ; } return wasValidAtEitherLevel ; }
This keeps us from reverting the same prefab over and over, which otherwise happens when we're doing checks for nested prefabs.
This keeps us from reverting the same prefab over and over which otherwise happens when we ' re doing checks for nested prefabs .
obj
GameObject
Dictionary<UnityEngine.Object, bool>
ref