Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. We have updated the language to the Editor Terms based on feedback from our employees and community. Learn more.
    Dismiss Notice

Question ScriptedImporter behavior

Discussion in 'Editor & General Support' started by arcnor, Apr 27, 2020.

  1. arcnor

    arcnor

    Joined:
    Nov 29, 2014
    Posts:
    21
    Hi,

    I've created a ScriptedImporter for my custom format (which contains multiple subassets) and I'm using Unity 2019.3.9. Besides many bugs with refreshing the editor after importing, I cannot see any GUID on my meta files nor any of my generated subassets data (besides the GUID for the custom file itself, but again not for any of my generated assets), which suggests to me that the file will just be reimported after the Library folder is gone (like in CI/CD) as well as my current GUID will be lost.

    The contents of my file are the usual "unknown filetype" ones, like:
    Code (CSharp):
    1. fileFormatVersion: 2
    2. guid: fcbb2eb54dbf548d6ae87c0919d00b2b
    3. DefaultImporter:
    4.   externalObjects: {}
    5.   userData:
    6.   assetBundleName:
    7.   assetBundleVariant:
    8.  
    Am I missing something, is this a bug or is the content of my import stored somewhere else?
     
  2. arcnor

    arcnor

    Joined:
    Nov 29, 2014
    Posts:
    21
    So it looks like if I now delete the existing meta, I get a new one with "ScriptedImporter" instead of the "DefaultImporter". However, there are no fields on the meta file, UNLESS I add fields to the importer itself, which doesn't make much sense to me. Maybe somebody can explain to me why does the meta file contain the metadata of the importer, instead of the stuff I'm adding to the context using `AddObjectToAsset`?

    Thanks.