public class NPCPlanner : MonoBehaviour {
private List<PlanAction> plan;
private int currentAction;
private NavMeshAgent agent;
public WaypointInfo[] waypoints;
void Start(){
plan = new List<PlanAction>();
agent = GetComponent<NavMeshAgent>();
currentAction = 0;
[
public struct WaypointInfo
{
System.Serializable]
public string name;
public Transform waypoint;
}
try{
Process planner = new Process();
planner.StartInfo.FileName = "Planner/hsp2.exe";
planner.StartInfo.CreateNoWindow = true;
planner.StartInfo.Arguments = "Planner/game-problem.pddl
Planner/game-domain.pddl";
planner.StartInfo.UseShellExecute = false;
planner.StartInfo.RedirectStandardOutput = true;
planner.Start();
planner.WaitForExit();
while (!planner.StandardOutput.EndOfStream){
plan.Add(new PlanAction(planner.StandardOutput.ReadLine()));
}
}catch (System.Exception e){
UnityEngine.Debug.Log(e);
}
}