"Open X in prefab mode to select and edit Y" messages aren't spammed

This commit is contained in:
yasirkula
2021-12-04 17:04:19 +03:00
parent dcc5d5e0ad
commit d5942a66c4
@@ -242,7 +242,8 @@ namespace AssetUsageDetectorNamespace
PrefabStage openPrefabStage = PrefabStageUtility.GetCurrentPrefabStage();
// Try to open the prefab stage of pinged prefabs if they are double clicked
if( previousPingedPrefabInstanceId == objTR.GetInstanceID() && EditorApplication.timeSinceStartup - previousPingedPrefabPingTime <= 0.3f &&
bool previousPingedPrefabIsDoubleClicked = previousPingedPrefabInstanceId == objTR.GetInstanceID();
if( previousPingedPrefabIsDoubleClicked && EditorApplication.timeSinceStartup - previousPingedPrefabPingTime <= 0.3f &&
#if UNITY_2020_1_OR_NEWER
( openPrefabStage == null || !openPrefabStage.stageHandle.IsValid() || assetPath != openPrefabStage.assetPath ) )
#else
@@ -272,12 +273,17 @@ namespace AssetUsageDetectorNamespace
#if UNITY_2019_1_OR_NEWER
else if( obj != objTR.gameObject )
{
Debug.Log( "Open " + assetPath + " in prefab mode to select and edit " + obj.name );
if( !previousPingedPrefabIsDoubleClicked ) // Don't spam this log unnecessarily
Debug.Log( "Open " + assetPath + " in prefab mode to select and edit " + obj.name );
selection = objTR.gameObject;
}
#else
else
Debug.Log( "Open " + assetPath + " in prefab mode to select and edit " + obj.name );
{
if( !previousPingedPrefabIsDoubleClicked ) // Don't spam this log unnecessarily
Debug.Log( "Open " + assetPath + " in prefab mode to select and edit " + obj.name );
}
#endif
}
#else