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); }
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; }