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

Resolved automatically regenerate units?

Discussion in 'Visual Scripting' started by Maskedchamo, Sep 18, 2021.

  1. Maskedchamo

    Maskedchamo

    Joined:
    Mar 12, 2018
    Posts:
    23
    I want to double check the following, just to be sure I am not missing an amazing functionality.

    Do I need to manually regenerate the units every time I create a new c# script/method for it to appear in the fuzzy finder?

    Thanks in advance.
     
  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    If it's a completely new script - yes, you have to manually regen all nodes.

    If it's a modification to an existing script, you could enable Automatic Unit Update in Project Settings/Visual Scripting. This will auto refresh already added types to reflect any changes made after domain reload. It can be a double edged sword, however, as it will happen on every single domain reload and incurs extra waiting time even when you don't want to Update existing types.

    I'd like to petition Unity to re-add the manual Update Unit Options button Bolt had previously, no idea why it was removed in the first place. I guess because all the stuff has moved from Tools/Bolt to Project Settings but there's enough space there to add one more button since Update Unit Options is way faster than Regenerate Unit Options.
     
    Last edited: Sep 18, 2021
  3. Maskedchamo

    Maskedchamo

    Joined:
    Mar 12, 2018
    Posts:
    23
    Thanks PanthenEye.

    Am I right to assume I can trigger the update you mentioned that way?
    Code (CSharp):
    1. UnitBase.Update();
     
  4. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,050
    That should be it, yeah.
     
  5. Maskedchamo

    Maskedchamo

    Joined:
    Mar 12, 2018
    Posts:
    23
    Cool, thanks.