No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

UnifiedVariableUnit.cs 1.0KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. using UnityEngine;
  2. namespace Unity.VisualScripting
  3. {
  4. [SpecialUnit]
  5. public abstract class UnifiedVariableUnit : Unit, IUnifiedVariableUnit
  6. {
  7. /// <summary>
  8. /// The kind of variable.
  9. /// </summary>
  10. [Serialize, Inspectable, UnitHeaderInspectable]
  11. public VariableKind kind { get; set; }
  12. /// <summary>
  13. /// The name of the variable.
  14. /// </summary>
  15. [DoNotSerialize]
  16. [PortLabelHidden]
  17. public ValueInput name { get; private set; }
  18. /// <summary>
  19. /// The source of the variable.
  20. /// </summary>
  21. [DoNotSerialize]
  22. [PortLabelHidden]
  23. [NullMeansSelf]
  24. public ValueInput @object { get; private set; }
  25. protected override void Definition()
  26. {
  27. name = ValueInput(nameof(name), string.Empty);
  28. if (kind == VariableKind.Object)
  29. {
  30. @object = ValueInput<GameObject>(nameof(@object), null).NullMeansSelf();
  31. }
  32. }
  33. }
  34. }