Class VariableModel
Data model representing a variable.
Implements
Inherited Members
Namespace: Unity.Behavior.GraphFramework
Assembly: Unity.Behavior.GraphFramework.dll
Syntax
[Serializable]
public abstract class VariableModel : IEquatable<VariableModel>
Fields
ID
ID of the variable.
Declaration
[SerializeField]
public SerializableGUID ID
Field Value
Type | Description |
---|---|
SerializableGUID |
IsExposed
Boolean indicating whether the variable is exposed.
Declaration
[SerializeField]
public bool IsExposed
Field Value
Type | Description |
---|---|
bool |
Name
Name of the variable.
Declaration
[SerializeField]
public string Name
Field Value
Type | Description |
---|---|
string |
Properties
IsShared
Bool indicating whether the variable is shared.
Declaration
public bool IsShared { get; set; }
Property Value
Type | Description |
---|---|
bool |
ObjectValue
Interface for getting or setting the value of the variable.
Declaration
public abstract object ObjectValue { get; set; }
Property Value
Type | Description |
---|---|
object |
Type
Interface for getting the type of the variable.
Declaration
public abstract Type Type { get; }
Property Value
Type | Description |
---|---|
Type |
Methods
Equals(object)
Compares an object to this variable model, casts to VariableModel and invokes an id and type check.
Declaration
public override bool Equals(object other)
Parameters
Type | Name | Description |
---|---|---|
object | other | Object to compare. |
Returns
Type | Description |
---|---|
bool | True if equal, false otherwise |
Overrides
Equals(VariableModel)
Compares two VariableModels for equality of ID and Type.
Declaration
public bool Equals(VariableModel other)
Parameters
Type | Name | Description |
---|---|---|
VariableModel | other | VariableModel to compare to. |
Returns
Type | Description |
---|---|
bool | True if equal, false otherwise |
GetHashCode()
Get's the hash code of the variable ID.
Declaration
public override int GetHashCode()
Returns
Type | Description |
---|---|
int | The hash code. |
Overrides
OnValidate()
Base method allowing variable models to be validated.
Declaration
public virtual void OnValidate()
Events
IsSharedChanged
Callback used for changes in the variable IsShared value.
Declaration
public event VariableModel.IsSharedChangedCallback IsSharedChanged
Event Type
Type | Description |
---|---|
VariableModel.IsSharedChangedCallback |
Operators
operator ==(VariableModel, VariableModel)
Compares two VariableModels for equality of ID and Type.
Declaration
public static bool operator ==(VariableModel a, VariableModel b)
Parameters
Type | Name | Description |
---|---|---|
VariableModel | a | First to compare. |
VariableModel | b | Second to compare. |
Returns
Type | Description |
---|---|
bool | True if equal, false otherwise |
operator !=(VariableModel, VariableModel)
Compares two VariableModels for oinequality of ID and Type.
Declaration
public static bool operator !=(VariableModel a, VariableModel b)
Parameters
Type | Name | Description |
---|---|---|
VariableModel | a | First to compare. |
VariableModel | b | Second to compare. |
Returns
Type | Description |
---|---|
bool | True if not equal, false otherwise. |