本文整理汇总了C#中Path.Claim方法的典型用法代码示例。如果您正苦于以下问题:C# Path.Claim方法的具体用法?C# Path.Claim怎么用?C# Path.Claim使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Path
的用法示例。
在下文中一共展示了Path.Claim方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPathComplete
/** Called when a path has completed.
* Will post process it and return it by calling #tmpPathCallback and #pathCallback
*/
void OnPathComplete (Path p, bool runModifiers, bool sendCallbacks) {
AstarProfiler.StartProfile ("Seeker OnPathComplete");
if (p != null && p != path && sendCallbacks) {
return;
}
if (this == null || p == null || p != path)
return;
if (!path.error && runModifiers) {
AstarProfiler.StartProfile ("Seeker Modifiers");
// This will send the path for post processing to modifiers attached to this Seeker
RunModifiers (ModifierPass.PostProcess, path);
AstarProfiler.EndProfile ();
}
if (sendCallbacks) {
p.Claim (this);
AstarProfiler.StartProfile ("Seeker Callbacks");
lastCompletedNodePath = p.path;
lastCompletedVectorPath = p.vectorPath;
// This will send the path to the callback (if any) specified when calling StartPath
if (tmpPathCallback != null) {
tmpPathCallback (p);
}
// This will send the path to any script which has registered to the callback
if (pathCallback != null) {
pathCallback (p);
}
// Recycle the previous path to reduce the load on the GC
if (prevPath != null) {
prevPath.ReleaseSilent (this);
}
prevPath = p;
// If not drawing gizmos, then storing prevPath is quite unecessary
// So clear it and set prevPath to null
if (!drawGizmos) ReleaseClaimedPath ();
AstarProfiler.EndProfile();
}
AstarProfiler.EndProfile ();
}
示例2: OnPathComplete
void OnPathComplete (Path p) {
waitingForPathCalc = false;
p.Claim(this);
if (p.error) {
p.Release(this);
return;
}
if (traversingSpecialPath) {
delayUpdatePath = true;
} else {
if (rp == null) rp = new RichPath();
rp.Initialize (seeker, p,true, funnelSimplification);
}
p.Release(this);
}