/// <inheritdoc/> public override void Initialize(ScenarioAgent parentAgent) { base.Initialize(parentAgent); ParentAgent.ExtensionAdded += ParentAgentOnExtensionAdded; ParentAgent.ExtensionRemoved += ParentAgentOnExtensionRemoved; var behaviourExtension = ParentAgent.GetExtension <AgentBehaviour>(); if (behaviourExtension != null) { behaviourExtension.BehaviourChanged += ParentAgentOnBehaviourChanged; } }
/// <inheritdoc/> public override void CopyProperties(ScenarioAgent agent) { var origin = agent.GetExtension <AgentDestinationPoint>(); if (origin == null) { return; } var destinationPoint = ParentAgent.GetComponentInChildren <ScenarioDestinationPoint>(true); if (destinationPoint != null) { destinationPoint.AttachToAgent(ParentAgent, false); } }
/// <inheritdoc/> public override void Deinitialize() { ParentAgent.ExtensionAdded -= ParentAgentOnExtensionAdded; ParentAgent.ExtensionRemoved -= ParentAgentOnExtensionRemoved; var behaviourExtension = ParentAgent.GetExtension <AgentBehaviour>(); if (behaviourExtension != null) { behaviourExtension.BehaviourChanged -= ParentAgentOnBehaviourChanged; } for (var i = waypoints.Count - 1; i >= 0; i--) { var waypoint = waypoints[i]; waypoint.RemoveFromMap(); waypoint.Dispose(); } base.Deinitialize(); }
public override void OnBegin() { base.OnBegin(); ParentAgent?.Call(FunctionName); }
public override void OnBegin() { base.OnBegin(); ParentAgent?.QueueFree(); }