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. Dismiss Notice

Question How to regenerate units by script?

Discussion in 'Visual Scripting' started by URocks, Aug 26, 2021.

  1. URocks

    URocks

    Joined:
    May 1, 2014
    Posts:
    159
    I am using a lot of custom enums and always when I create a new one in normal C# script I need to regenerate units for enum to appear in a searchable unit window inside flowgraph

    Is there a way how to regenerate units by script?
     
  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    1,763
    Are you asking for selective per script node regen? If so, that type of functionality does not exist currently.
     
  3. URocks

    URocks

    Joined:
    May 1, 2014
    Posts:
    159
    No I am just asking for the code how to trigger regenerate units from external script, so i can trigger it from custom inspector button
     
  4. MasterSubby

    MasterSubby

    Joined:
    Sep 5, 2012
    Posts:
    252
    You can use this static method:

    Code (CSharp):
    1. UnitBase.Rebuild()
     
    URocks likes this.