当前位置: 首页>>代码示例>>C#>>正文


C# Path.DebugString方法代码示例

本文整理汇总了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);
		}
	}
开发者ID:JackHR,项目名称:WaveIncoming,代码行数:19,代码来源:AstarPath.cs

示例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);
		//	}
	}
开发者ID:pravusjif,项目名称:PravusUnityTests,代码行数:55,代码来源:AstarPath.cs


注:本文中的Pathfinding.Path.DebugString方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。