本文整理匯總了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);
// }
}