public void PFFindPath(Follower agent, PathFindingGoal pFGoal) { //Debug.Log("here"); Type myType = null; try { myType = Type.GetType("PathFinding"); } catch { myType = null; SPData.FollowerType = FollowerType.Simple; } if (myType != null) { object instance = Activator.CreateInstance(myType); MethodInfo myMethod = myType.GetMethod("FindAgentShortestPathToGoal"); if (myMethod != null) { myMethod.Invoke(instance, new object[] { SPData, agent, pFGoal }); } else { Debug.Log("Method FindShortestPathDijkstra not found"); } } else { Debug.Log(" Path finding package is not found"); } }
IEnumerator PFFollowerUpdatePath(Follower agent, PathFindingGoal pFGoal) { yield return(new WaitForSeconds(agent.UpdateTime)); PFFindPath(agent, pFGoal); }