Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct here to familiarize yourself with the rules and how to post constructively.

  2. Unity 2022.1 is now available as the latest Tech release.
    Dismiss Notice
  3. Improve your project's performance with our new guide on profiling in Unity.
    Dismiss Notice

Finding External references in prefab for testing

Discussion in 'Prefabs' started by kaimelis, Jun 21, 2019.

  1. kaimelis

    kaimelis

    Joined:
    Apr 28, 2016
    Posts:
    18
    Hi. I am trying to find which prefabs have external references and just print them out.
    I normally go through all the objects in scene. Get the prefabs and then I would like to check if any of the prefabs have external references. Thank you if anyone knows it.
    I upload the photo that Unity has this check and I just want to recreate it for automated testing purposes.
     

    Attached Files:

  2. kaimelis

    kaimelis

    Joined:
    Apr 28, 2016
    Posts:
    18
    Ok. Found the solution. Just use
    Code (CSharp):
    1. bool canBeSaved = EditorUtility.IsPersistent(gb.instanceObject);
     
unityunity