/// <inheritdoc/>
        public override void CopyProperties(ScenarioAgent agent)
        {
            var origin = agent.GetExtension <AgentSensorsConfiguration>();

            if (origin == null)
            {
                return;
            }
            SensorsConfigurationId = origin.SensorsConfigurationId;
        }
Ejemplo n.º 2
0
        /// <inheritdoc/>
        public override void CopyProperties(ScenarioAgent agent)
        {
            var origin = agent.GetExtension <AgentBehaviour>();

            if (origin == null)
            {
                return;
            }
            Behaviour           = origin.Behaviour;
            BehaviourParameters = JSON.Parse(origin.BehaviourParameters.ToString()) as JSONObject;
        }
        /// <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);
            }
        }
Ejemplo n.º 4
0
        /// <summary>
        /// Attach this destination point to the agent
        /// </summary>
        /// <param name="agent">Scenario agent to which destination point will be attached</param>
        /// <param name="initializeTransform">Should this attach initialize the transform</param>
        public void AttachToAgent(ScenarioAgent agent, bool initializeTransform)
        {
            ParentAgent = agent;
            var extension = agent.GetExtension <AgentDestinationPoint>();

            extension.DestinationPoint = this;
            if (!initializeTransform)
            {
                return;
            }
            transform.SetParent(agent.transform);
            var forward = agent.TransformToMove.forward;

            TransformToMove.localPosition   = forward * InitialOffset;
            TransformToRotate.localRotation = Quaternion.LookRotation(forward);
            Refresh();
        }
Ejemplo n.º 5
0
        /// <inheritdoc/>
        public override void CopyProperties(ScenarioAgent agent)
        {
            var origin = agent.GetExtension <AgentWaypoints>();

            if (origin == null)
            {
                return;
            }

            PathRenderer.positionCount = 0;
            for (var i = 0; i < ParentAgent.transform.childCount; i++)
            {
                var child = ParentAgent.transform.GetChild(i);
                if (child.name == WaypointsObjectName)
                {
                    waypointsParent = child;
                    for (var j = 0; j < waypointsParent.childCount; j++)
                    {
                        var waypoint = waypointsParent.GetChild(j).GetComponent <ScenarioWaypoint>();
                        AddWaypoint(waypoint, waypoint.IndexInAgent);
                    }
                }
            }
        }