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


C# Path.Claim方法代码示例

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

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


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