Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

How do you make an editor script?

Discussion in 'Visual Scripting' started by laurentlavigne, Nov 2, 2020.

  1. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,222
    Let's say I want to replace all objects with a certain name with another object within every scene, and changes saved. How can this be done in the visual scripting?
     
  2. Ex-Crow

    Ex-Crow

    Joined:
    Aug 14, 2020
    Posts:
    111
    Bolt in its current form can't do editor scripts. Unity have discussed the possibility of triggering Bolt graphs in the editor though, but I don't believe we have clarity on that topic just yet. The functionality might be implemented later on.

    The only way to run anything in Bolt at edit time is to import Bolt Community Addons pack from here: https://github.com/RealityStop/Bolt.Addons.Community and then run Tools/Bolt/Build Unit Options. After that you'll be able to add Manual Event to Bolt graphs. It has a button on it that you can click to execute Bolt graph code at edit time or runtime.
     
    laurentlavigne likes this.
  3. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,222
    Thanks! I don't see any nodes exposing the editor stufflike selection or load/saving of prefabs and scenes. Do they exist or are these things I can write myself?
     
  4. Ex-Crow

    Ex-Crow

    Joined:
    Aug 14, 2020
    Posts:
    111
    Bolt by default exposes only the most commonly used types. You might need to add missing types manually in Tools/Bolt/Unit Options Wizard.
     
  5. laurentlavigne

    laurentlavigne

    Joined:
    Aug 16, 2012
    Posts:
    6,222
    Oh ok click of a button is how it's done, I could get used to this convenience. cheers.