using UnityEngine;
namespace Unity.VisualScripting
{
[SpecialUnit]
public abstract class UnifiedVariableUnit : Unit, IUnifiedVariableUnit
{
///
/// The kind of variable.
///
[Serialize, Inspectable, UnitHeaderInspectable]
public VariableKind kind { get; set; }
///
/// The name of the variable.
///
[DoNotSerialize]
[PortLabelHidden]
public ValueInput name { get; private set; }
///
/// The source of the variable.
///
[DoNotSerialize]
[PortLabelHidden]
[NullMeansSelf]
public ValueInput @object { get; private set; }
protected override void Definition()
{
name = ValueInput(nameof(name), string.Empty);
if (kind == VariableKind.Object)
{
@object = ValueInput(nameof(@object), null).NullMeansSelf();
}
}
}
}