You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
// First check if input GameObject is persistent before checking what stage the GameObject is in
if(EditorUtility.IsPersistent(go))
{
if(!PrefabUtility.IsPartOfPrefabAsset(go))
{
Debug.Log("The GameObject is a temporary object created during import. OnValidate() is called two times with a temporary object during import: First time is when saving cloned objects to .prefab file. Second event is when reading .prefab file objects during import");
}
else
{
Debug.Log("GameObject is part of an imported Prefab Asset (from the Library folder)");
}
return;
}
// If the GameObject is not persistent let's determine which stage we are in first because getting Prefab info depends on it
Debug.Log(string.Format("GameObject is part of a Prefab Instance in the MainStage and is of type: {0}. It comes from the prefab asset: {1}",type,path));
}
else
{
Debug.Log("GameObject is a plain GameObject in the MainStage");
Debug.Log(string.Format("GameObject is in a PrefabStage. The GameObject is part of a nested Prefab Instance and is of type: {0}. The opened Prefab asset is: {1} and the nested Prefab asset is: {2}",type,prefabStage.prefabAssetPath,nestedPrefabPath));
Debug.Log(string.Format("GameObject is in a PrefabStage. The opened Prefab is of type: {0}. The GameObject comes from the prefab asset: {1}",type,prefabStage.prefabAssetPath));
Debug.Log("GameObject is not in the MainStage, nor in a PrefabStage. But it is in a PreviewScene so could be used for Preview rendering or other utilities.");
// First check if input GameObject is persistent before checking what stage the GameObject is in
if(EditorUtility.IsPersistent(go))
{
if(!PrefabUtility.IsPartOfPrefabAsset(go))
{
stringBuilder.Append("The GameObject is a temporary object created during import. OnValidate() is called two times with a temporary object during import: First time is when saving cloned objects to .prefab file. Second event is when reading .prefab file objects during import");
}
else
{
stringBuilder.Append("GameObject is part of an imported Prefab Asset (from the Library folder).\n");