示例#1
0
        public static PathHandler CreateFrom(AgentPathData data, DynamicBuffer <AgentPathBuffer> pathBuffer)
        {
            PathHandler agentPath = new PathHandler();

            agentPath.Path         = pathBuffer;
            agentPath.PathLength   = data.PathLength;
            agentPath.CurrentIndex = data.CurrentIndex;

            return(agentPath);
        }
示例#2
0
        private void Update()
        {
            if (!Controller.CrowdController.TryGetAgent(CrowdIndex, out NavAgentDebug))
            {
                return;
            }

            NavAgent      agent    = NavAgentDebug.NavAgent;
            AgentPathData pathData = NavAgentDebug.PathData;

            //transform.position = Vector3.MoveTowards(transform.position, readOnlyAgent.DtCrowdAgent.Position, Time.deltaTime * 10f);
            transform.position = agent.DtCrowdAgent.Position;
        }