Class BlackboardVariable
A variable used within a blackboard.
Inherited Members
Namespace: Unity.Behavior
Assembly: Unity.Behavior.dll
Syntax
[Serializable]
public abstract class BlackboardVariable
Fields
GUID
A GUID used to uniquely identify the variable.
Declaration
[SerializeField]
public SerializableGUID GUID
Field Value
| Type | Description |
|---|---|
| SerializableGUID |
Name
The name of the variable.
Declaration
[SerializeField]
public string Name
Field Value
| Type | Description |
|---|---|
| string |
Properties
ObjectValue
The value of the variable.
Declaration
public abstract object ObjectValue { get; set; }
Property Value
| Type | Description |
|---|---|
| object |
Type
The type of the variable.
Declaration
public abstract Type Type { get; }
Property Value
| Type | Description |
|---|---|
| Type |
Methods
Equals(BlackboardVariable)
Returns true if the two variables are equal and false otherwise.
Declaration
public virtual bool Equals(BlackboardVariable other)
Parameters
| Type | Name | Description |
|---|---|---|
| BlackboardVariable | other | The variable to compare to. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if the two variables are equal and false otherwise. |
InvokeValueChanged()
Invokes the OnValueChanged callback. This method should be called when the internal value has been modified without using the Value property setter.
Common scenarios includes:
- When modifying collection elements (e.g., adding/removing items from a List)
- When modifying properties of a reference type stored in the value
Declaration
public void InvokeValueChanged()
SetObjectValueWithoutNotify(object)
Allow to set the object value without being notified of the change, if any.
Declaration
public abstract void SetObjectValueWithoutNotify(object newValue)
Parameters
| Type | Name | Description |
|---|---|---|
| object | newValue | The new value to be assigned. |
ValueEquals(BlackboardVariable)
Returns true if the values of the two variables are equal and false otherwise.
Declaration
public abstract bool ValueEquals(BlackboardVariable other)
Parameters
| Type | Name | Description |
|---|---|---|
| BlackboardVariable | other | The variable whose value is compared to. |
Returns
| Type | Description |
|---|---|
| bool | Returns true if the values of the two variables are equal and false otherwise. |
Events
OnValueChanged
Callback used for changes in the blackboard variable value.
Declaration
public event BlackboardVariable.ValueChangedCallback OnValueChanged
Event Type
| Type | Description |
|---|---|
| BlackboardVariable.ValueChangedCallback |