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.

Question [Bug?] Custom EventUnit<T> disappear from dropdown list

Discussion in 'Visual Scripting' started by Sarono, Nov 26, 2022.

  1. Sarono

    Sarono

    Joined:
    Apr 12, 2018
    Posts:
    2
    Visual Scripting version: 1.7.8
    Unity version: 2021.3.0f1

    After coding and regen nodes, custom EventUnit disappear from dropdown list.
    The already exist custom EventUnit work fine, e.g. Effect_OnDestroy node.
    I create a new project, use the same code, it's work fine.

    upload_2022-11-26_21-38-21.png

    Code (CSharp):
    1. using Unity.VisualScripting;
    2.  
    3. namespace Gameplay.Ability.VisualScripting
    4. {
    5.     [UnitCategory("Events\\Gameplay")]
    6.     public abstract class EffectGamepleyEvent : EventUnit<GameplayEventArgs>
    7.     {
    8.         [DoNotSerialize]
    9.         public ValueOutput Sender { get; private set; }
    10.         [DoNotSerialize]
    11.         public ValueOutput EventArgs { get; private set; }
    12.  
    13.         protected override bool register => true;
    14.  
    15.         protected override void Definition()
    16.         {
    17.             base.Definition();
    18.             Sender = ValueOutput<EffectObj>(nameof(Sender));
    19.             EventArgs = ValueOutput<GameplayEventArgs>(nameof(EventArgs));
    20.         }
    21.  
    22.         protected override void AssignArguments(Flow flow, GameplayEventArgs data)
    23.         {
    24.             flow.SetValue(Sender, flow.stack.component.gameObject.GetComponent<EffectVisualScripting>().Sender);
    25.             flow.SetValue(EventArgs, data);
    26.         }
    27.     }
    28.  
    29.     [UnitTitle("Effect_OnCreated")]
    30.     public sealed class Effect_OnCreated : EffectGamepleyEvent
    31.     {
    32.         public override EventHook GetHook(GraphReference reference)
    33.         {
    34.             return new EventHook(nameof(Effect_OnCreated), reference.gameObject);
    35.         }
    36.     }
    37.  
    38.     [UnitTitle("Effect_OnDestroy")]
    39.     public sealed class Effect_OnDestroy : EffectGamepleyEvent
    40.     {
    41.         public override EventHook GetHook(GraphReference reference)
    42.         {
    43.             return new EventHook(nameof(Effect_OnDestroy), reference.gameObject);
    44.         }
    45.     }
    46.  
    47.     [UnitTitle("Effect_OnPeriod")]
    48.     public sealed class Effect_OnPeriod : EffectGamepleyEvent
    49.     {
    50.         public override EventHook GetHook(GraphReference reference)
    51.         {
    52.             return new EventHook(nameof(Effect_OnPeriod), reference.gameObject);
    53.         }
    54.     }
    55. }
    56.  
    # Other Error:

    Objects are trying to be loaded during a domain backup. This is not allowed as it will lead to undefined behaviour!