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


C# Path.Release方法代码示例

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

示例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);
     }
 }
开发者ID:jgirald,项目名称:ES2015F,代码行数:14,代码来源:UnitMovement.cs

示例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);
    }
开发者ID:dvan3,项目名称:penance,代码行数:15,代码来源:DemonTargeting.cs

示例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;
                    }
                }
            }
        }
    }
开发者ID:kaldrick,项目名称:Roguelike2,代码行数:55,代码来源:AIController.cs

示例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);
		}
开发者ID:moderndelta137,项目名称:Shadow_Sword,代码行数:17,代码来源:RichAI.cs

示例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();
            }
        }
开发者ID:Maxii,项目名称:CodeEnv.Master,代码行数:17,代码来源:FleetCmdItem.cs

示例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;
        }
    }
开发者ID:RamiAhmed,项目名称:R2R_Test1,代码行数:15,代码来源:Entity.cs


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