Search Unity

Question How to find type in serialization of object references

Discussion in 'Asset Database' started by jvella_ea, Mar 16, 2023.

  1. jvella_ea

    jvella_ea

    Joined:
    Jan 11, 2023
    Posts:
    1
    I'm looking at potentially writing asset references directly to file and i can't seem to find information about the type number that shows up in the following:

    Code (CSharp):
    1.   - {fileID: 2800000, guid: 2c21bf9c930f2af43b5a9e2c16b8ec4b, type: 3}
    2.   - {fileID: 11400000, guid: 95148f1d2db534f8b81fbd19ea806575, type: 2}
    I havent seen anything other than 2 or 3 and it seems to roughly correspond to:
    UnityEngine.Object 2 (Texture, ScriptableObject etc)
    MonoBehavior 3
    Prefab 3

    Does anyone have more information about how i could reliably generate this number? preferably just using path, fileID, guid, and System.Type. Thanks!