Search Unity

Question How to make MonoBehaviour of a Package visible?

Discussion in 'Visual Scripting' started by Kinggrass, Mar 24, 2023.

  1. Kinggrass

    Kinggrass

    Joined:
    Jun 7, 2016
    Posts:
    72
    Hello everyone,

    like the title is already asking.
    I already put the Assembly Reference under the Visual Scripting Setting in the Project Settings and regenerating the nodes but it does not help.
    Also I added [Inspectable] to the Class but it still does not show up.

    Any more ideas to try?
     
  2. Kinggrass

    Kinggrass

    Joined:
    Jun 7, 2016
    Posts:
    72
    Okay, I found it.
    I had to additional add the Type in the "Type Options".

    Is there somehow a way to add the Types automatically?

    TM Pro Types are also all availabe but not added in the Type Options. How can I archive the same?
     
  3. Kinggrass

    Kinggrass

    Joined:
    Jun 7, 2016
    Posts:
    72
    And the Methods are not accessable over the visual script, what do I do wrong?
    I can now reference the object but I can't add class specific nodes.
     
  4. PanthenEye

    PanthenEye

    Joined:
    Oct 14, 2013
    Posts:
    2,076
    It's hard to tell without seeing the code you're trying to expose to UVS. Anything you want exposed has to be public first of all. And besides the Project Settings way of adding new assemblies/types, you can also decorate your class with [IncludeInSettings(true)] attribute and then regenerate nodes and it'll be automatically added to type options.

    If you want your own code exposed like TMPro assembly, then you must also group your scripts into custom assemblies and add those.
     
  5. Kinggrass

    Kinggrass

    Joined:
    Jun 7, 2016
    Posts:
    72
    @PanthenEye Thanks for your response,

    I see you are a active member in this subthread:
    In the package everything is clustered in assemblies for editor, runtime and samples.
    And the runtime assembly is referenced in the project settings of the UVS.
    The methods are all public.

    I will try to decorate it with [IncludeInSettings(true)] additional.