Class BehaviorGraph
BehaviorGraph holds all the runtime graph instances linked together into a complete behaviour defined within a BehaviorAuthoringGraph.
Implements
Inherited Members
Object.InstantiateAsync<T>(T)
Object.InstantiateAsync<T>(T, Transform)
Object.InstantiateAsync<T>(T, Vector3, Quaternion)
Object.InstantiateAsync<T>(T, Transform, Vector3, Quaternion)
Object.Instantiate<T>(T, InstantiateParameters)
Object.Instantiate<T>(T, Vector3, Quaternion, InstantiateParameters)
Object.FindObjectsByType<T>(FindObjectsSortMode)
Object.FindObjectsByType<T>(FindObjectsInactive, FindObjectsSortMode)
Object.FindFirstObjectByType<T>()
Object.FindAnyObjectByType<T>()
Object.FindFirstObjectByType<T>(FindObjectsInactive)
Object.FindAnyObjectByType<T>(FindObjectsInactive)
Namespace: Unity.Behavior
Assembly: Unity.Behavior.dll
Syntax
[Serializable]
[GeneratePropertyBag]
public class BehaviorGraph : ScriptableObject, ISerializationCallbackReceiver
Properties
BlackboardReference
The blackboard reference used for accessing variables.
Declaration
public BlackboardReference BlackboardReference { get; }
Property Value
| Type | Description |
|---|---|
| BlackboardReference |
IsRunning
True if the graph is running, false otherwise.
Declaration
public bool IsRunning { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
End()
Ends the execution of the behavior graph.
Declaration
public void End()
HasSameSourceAssetAs(BehaviorGraph)
Determines whether this BehaviorGraph instance and the specified other graph
originate from the same source asset.
Declaration
public bool HasSameSourceAssetAs(BehaviorGraph other)
Parameters
| Type | Name | Description |
|---|---|---|
| BehaviorGraph | other | The other BehaviorGraph to compare against. |
Returns
| Type | Description |
|---|---|
| bool | True if both graphs have a valid graph module and their AuthoringAssetID values are equal; False otherwise. |
OnAfterDeserialize()
Declaration
public void OnAfterDeserialize()
OnBeforeSerialize()
Declaration
public void OnBeforeSerialize()
Restart()
Resets the execution state and restarts the graph.
Declaration
public void Restart()
Start()
Begins execution of the behavior graph.
Declaration
public void Start()
Tick()
Executes one step of the graph.
Declaration
public void Tick()