本文整理汇总了C#中Pathfinding.Path.Release方法的典型用法代码示例。如果您正苦于以下问题:C# Path.Release方法的具体用法?C# Path.Release怎么用?C# Path.Release使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pathfinding.Path
的用法示例。
在下文中一共展示了Path.Release方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: OnPathComplete
// Metodo que se llama cuando una ruta ha sido calculada
public void OnPathComplete (Path p) {
p.Claim (this);
if (!p.error) {
if (path != null) path.Release (this);
path = p;
currentWaypoint = 1;
} else {
p.Release (this);
Debug.Log ("No se puede llegar a este punto de destino: "+p.errorLog);
}
}
示例2: OnPathComplete
public void OnPathComplete(Path p)
{
p.Claim (this);
if (!p.error) {
if (path != null) path.Release (this);
path = p;
//Reset the waypoint counter
currentWaypoint = 0;
currentPathCount = path.vectorPath.Count;
} else {
p.Release (this);
Debug.Log ("The target was not reachable: "+p.errorLog);
}
}
示例3: OnPathComplete
public void OnPathComplete(Path p)
{
p.Claim (this);
if (!p.error) {
if (path != null) path.Release (this);
path = p;
//Reset the waypoint counter
currentAIWaypoint = 0;
} else {
p.Release (this);
//Debug.Log ("Oh noes, the target was not reachable: "+p.errorLog);
}
//seeker.StartPath (transform.position,targetPosition, OnPathComplete);
}
示例4: OnPathComplete
public void OnPathComplete(Path p)
{
if(target == null)
{
p.Claim (this);
// Debug.Log ("Yey, we got a path back. Did it have an error? "+p.error);
if (!p.error) {
if (path != null) path.Release (this);
path = p;
//Reset the waypoint counter
currentWaypoint = 0;
}
else {
p.Release (this);
bChangeWaypoint = true;
Debug.Log ("Oh noes, the target was not reachable: "+p.errorLog);
}
}
else
{
/*if (Time.time-lastPathSearch >= repathRate) {
Repath ();
} else {*/
StartCoroutine (WaitToRepath ());
//}
p.Claim (this);
//If the path didn't succeed, don't proceed
if (p.error) {
p.Release (this);
return;
}
else
{
//if(path != null) path.Release (this);
//Get the calculated path as a Vector3 array
path2 = p.vectorPath.ToArray();
//Find the segment in the path which is closest to the AI
//If a closer segment hasn't been found in '6' iterations, break because it is unlikely to find any closer ones then
float minDist = Mathf.Infinity;
int notCloserHits = 0;
for (int i=0;i<path2.Length-1;i++) {
float dist = Mathfx.DistancePointSegmentStrict (path2[i],path2[i+1],tr.position);
if (dist < minDist) {
notCloserHits = 0;
minDist = dist;
pathIndex = i+1;
} else if (notCloserHits > 6) {
break;
}
}
}
}
}
示例5: 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);
}
示例6: PathPlotCompletedEventHandler
private void PathPlotCompletedEventHandler(Path path) {
if (path.error) {
D.Warn("{0} generated an error plotting a course to {1}.", DebugName, ApTarget.DebugName);
HandleApCoursePlotFailure();
return;
}
ConstructApCourse(path.vectorPath);
path.Release(this);
if (_isPathReplotting) {
ResetPathReplotValues();
EngagePilot_Internal();
}
else {
HandleApCoursePlotSuccess();
}
}
示例7: OnPathComplete
private void OnPathComplete(Path p)
{
p.Claim(this);
if (!p.error) {
StopMoving();
isMoving = true;
path = p;
currentWaypoint = 0;
}
else {
p.Release(this);
isMoving = false;
}
}