本文整理汇总了C#中Pathfinding.Path.DebugString方法的典型用法代码示例。如果您正苦于以下问题:C# Path.DebugString方法的具体用法?C# Path.DebugString怎么用?C# Path.DebugString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pathfinding.Path
的用法示例。
在下文中一共展示了Path.DebugString方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LogPathResults
/** Prints path results to the log. What it prints can be controled using #logPathResults.
* \see #logPathResults
* \see PathLog
* \see Pathfinding.Path.DebugString
*/
private void LogPathResults (Path p) {
if (logPathResults == PathLog.None || (logPathResults == PathLog.OnlyErrors && !p.error)) {
return;
}
string debug = p.DebugString (logPathResults);
if (logPathResults == PathLog.InGame) {
inGameDebugPath = debug;
} else {
//Debug.Log (debug);
}
}
示例2: LogPathResults
/** Prints path results to the log. What it prints can be controled using #logPathResults.
* \see #logPathResults \n PathLog
* \todo Use string builder instead for lower memory footprint
*/
public void LogPathResults (Path p) {
//string debug = "";
if (logPathResults == PathLog.None || (logPathResults == PathLog.OnlyErrors && !p.error)) {
return;
}
string debug = p.DebugString (logPathResults);
if (logPathResults == PathLog.InGame) {
inGameDebugPath = debug;
} else {
Debug.Log (debug);
}
//Add stuff to the log
/*if (active.logPathResults == PathLog.Normal || logPathResults == PathLog.OnlyErrors) {
if (p.error) {
debug = "Path Failed : Computation Time: "+(p.duration).ToString ("0.00")+" ms Searched Nodes "+p.searchedNodes+"\nPath number: "+PathsCompleted+"\nError: "+p.errorLog;
} else {
debug = "Path Completed : Computation Time: "+(p.duration).ToString ("0.00")+" ms Path Length "+(p.path == null ? "Null" : p.path.Length.ToString ()) + " Searched Nodes "+p.searchedNodes+"\nSmoothed path length "+(p.vectorPath == null ? "Null" : p.vectorPath.Length.ToString ())+"\nPath number: "+p.pathID;
}
} else if (logPathResults == PathLog.Heavy || logPathResults == PathLog.InGame || logPathResults == PathLog.OnlyErrors) {
if (p.error) {
debug = "Path Failed : Computation Time: "+(p.duration).ToString ("0.000")+" ms Searched Nodes "+p.searchedNodes+"\nPath number: "+PathsCompleted+"\nError: "+p.errorLog;
} else {
debug = "Path Completed : Computation Time: "+(p.duration).ToString ("0.000")+" ms\nPath Length "+(p.path == null ? "Null" : p.path.Length.ToString ()) + "\nSearched Nodes "+p.searchedNodes+"\nSearch Iterations (frames) "+p.searchIterations+"\nSmoothed path length "+(p.vectorPath == null ? "Null" : p.vectorPath.Length.ToString ())+"\nEnd node\n G = "+p.endNode.g+"\n H = "+p.endNode.h+"\n F = "+p.endNode.f+"\n Point "+p.endPoint
+"\nStart Point = "+p.startPoint+"\n"+"Start Node graph: "+p.startNode.graphIndex+" End Node graph: "+p.endNode.graphIndex+"\nBinary Heap size at completion: "+(p.open == null ? "Null" : p.open.numberOfItems.ToString ())+"\nPath number: "+p.pathID;
}
/*if (active.logPathResults == PathLog.Heavy) {
Debug.Log (debug);
} else {
inGameDebugPath = debug;
}*
}
if (logPathResults == PathLog.Normal || logPathResults == PathLog.Heavy || (logPathResults == PathLog.OnlyErrors && p.error)) {
Debug.Log (debug);
} else if (logPathResults == PathLog.InGame) {
inGameDebugPath = debug;
}*/
//if ((p.error && logPathResults == PathLog.OnlyErrors) || logPathResults == PathLog.Normal) {
// Debug.Log (debug);
// }
}