public override void ExtractInterests(ChallengeStage stage) { base.ExtractInterests(stage); stageComponent = stage; if (stageComponent != null) { agentComponent = stageComponent.GetAgent(agentID); waypoints = stageComponent.GetAllWaypoints(); } }
protected override void PerformAction(float timeStep) { base.PerformAction(timeStep); if (agentComponent != null) { /*halmeida - if the route wasn't assigned, it means none of the required waypoints were loaded yet. * Maybe now they are loaded.*/ if (!routeAssigned && (stageComponent != null)) { waypoints = stageComponent.GetAllWaypoints(); agentComponent.ExtractRoutePositions(waypoints); routeAssigned = agentComponent.HasRoute(); } } }