Search Unity

Create Drop-list on Super Unit Input

Discussion in 'Visual Scripting' started by piscopancer, Sep 30, 2021.

  1. piscopancer

    piscopancer

    Joined:
    Jul 24, 2021
    Posts:
    15
    I have multiple options to choose from. Here they are on a screenshot as booleans. It is not comfortable. I want to make it compact and have those in a drop-list that appears on the input (like on the 2nd screenshot)

    If possible - step by step instruction :)

    Thanks

    my Super Unit
    upload_2021-9-30_12-30-14.png

    I want this thing (Yes I know it is enum, but you cannot create custom enums)

    upload_2021-9-30_12-31-33.png
     
  2. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,072
    You can pretty easily create custom enums.

    Code (CSharp):
    1. public enum MyBoolEnum
    2. {
    3.       Maximize,
    4.       AboveZero,
    5.       BelowZero
    6. }
    That's literally all you need inside a new empty C# script. Then run Tools/Bolt/Rebuild Unit Options and Bolt will automatically pick it up. It'll be available in fuzzy finder like any other type.

    To get a custom drop downs for non-enum types you'd have to code a custom node with a custom drawer or work with the source code of the asset to change how Superunits work.