Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Scriptedimporter with folder restriction

Discussion in 'Experimental Scripting Previews' started by Deleted User, May 28, 2020.

  1. Deleted User

    Deleted User

    Guest

    Hi everyone,

    from AssetPostProcessors I know that you can perform their operations on certain folders. Now with Scriptedimporters in the mix, does this still work the same way, or different?
    How would you go about configuring your ScriptedImporter in special cases?
     
  2. AnthonyReddan

    AnthonyReddan

    Joined:
    Feb 27, 2018
    Posts:
    39
    I have a
    ScriptedImporter
    that only operates on certain text files under a specific directory name. I use
    UnityEditor.AssetModificationProcessor
    and
    AssetPostProcessor
    to detect folder patterns in
    OnWillMove/OnWillCreate/Preprocess
    events and set the correct override importers (via
    AssetDatabaseExperimental.SetImporterOverride
    and
    AssetDatabaseExperimental.ClearImporterOverride
    ).
     
    Deleted User likes this.