Search Unity

ScriptedImporter : Serializable resources not being kept unless added to asset.

Discussion in 'Scripting' started by CyRaid, Jul 18, 2019.

  1. CyRaid


    Mar 31, 2015
    Like the subject says, after OnImportAsset, if I create resources (like Texture2D), they simply don't persist after OnImportAsset is done UNLESS if added them to asset with context.AddObjectToAsset()..

    Can the Unity developers save it along with other fields that are marked as serialized? I don't want to clutter the asset list with a bunch of stuff I'm only using in the editor inspector (ScirptedImporterEditor).

    For example, I have a sprite importer that allows you to recolor the layers in the inspector, and allow you to see the textures of each layer.. But the only assets I want saved are the 'combined' layers for each frame.. Not each layer and each frame (but only show the layer textures in the GUI).