コード例 #1
0
        /// <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;
            }
        }
コード例 #2
0
        /// <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);
            }
        }
コード例 #3
0
        /// <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();
        }
コード例 #4
0
 public override void OnBegin()
 {
     base.OnBegin();
     ParentAgent?.Call(FunctionName);
 }
コード例 #5
0
    public override void OnBegin()
    {
        base.OnBegin();

        ParentAgent?.QueueFree();
    }