title: Getting guid's from prefabs in Unity
body: <p>Kinda specific question, I'm working on a script which will retreive all unused materials and textures from the project and show/delete them. I went by path of GUID parsing from a scene file, but encountered a couple of problems, which, if can't be solved, make this solution impossible.</p>
  
  <p>1) In scene ".unity" file, when a prefab is used, it contains only this prefab's GUID, but prefab itself contains child objects - how can they be accessible?
  E.g: </p>
  
  <pre><code>Prefab:
    m_ObjectHideFlags: 0
    serializedVersion: 2
    m_Modification:
      m_TransformParent: {fileID: 0}
      m_Modifications:
      - target: {fileID: 444956, guid: 6a526c61069224c92930d52849053cbe, type: 2}
        propertyPath: m_LocalPosition.x
        value: 0
        objectReference: {fileID: 0}
  </code></pre>
  
  <p>And as well in the Project view there are no children more than second hierarchy level:
  <a href="https://i.stack.imgur.com/ZVq26.png" rel="nofollow"><img src="https://i.stack.imgur.com/ZVq26.png" alt="enter image description here"></a></p>
  
  <p>What I want to do - somehow to get all the materials AND textures used by, for example, "Ceiling" in the scene. Taking in account that "Blue" prefab is loaded at runtime, not present in the scene, so I can only take the root guid from the monobehaviour.</p>
  
  <p>2) Even if I somehow get all the used the materials, how to properly get textures used by them without accessing renderer of a gameobject, just these:</p>
  
  <p><a href="https://i.stack.imgur.com/An3rw.png" rel="nofollow"><img src="https://i.stack.imgur.com/An3rw.png" alt="enter image description here"></a></p>
  
  <p>I know it's a bit messy question, so please, ask if something is not clear. Thanks in advance.</p>