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


C# Node.GetNodeRun方法代码示例

本文整理汇总了C#中Pathfinding.Node.GetNodeRun方法的典型用法代码示例。如果您正苦于以下问题:C# Node.GetNodeRun方法的具体用法?C# Node.GetNodeRun怎么用?C# Node.GetNodeRun使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Pathfinding.Node的用法示例。


在下文中一共展示了Node.GetNodeRun方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: InSearchTree

 /** Returns if the node is in the search tree of the path.
  * Only guaranteed to be correct if \a path is the latest path calculated.
  * Use for gizmo drawing only.
  */
 public bool InSearchTree(Node node, Path path)
 {
     if (path == null || path.runData == null) return true;
     NodeRun nodeR = node.GetNodeRun (path.runData);
     return nodeR.pathID == path.pathID;
 }
开发者ID:rmkeezer,项目名称:fpsgame,代码行数:10,代码来源:Base.cs

示例2: NodeColor

        /// <summary>
        /// Returns a color to be used for the specified node with the current debug settings (editor only)
        /// </summary>
        /// <param name="node">
        /// A <see cref="Node"/>
        /// </param>
        /// <returns>
        /// A <see cref="Color"/>
        /// </returns>
        public virtual Color NodeColor(Node node, NodeRunData data)
        {
            Color c = AstarColor.NodeConnection;
            bool colSet = false;

            if (node == null) return AstarColor.NodeConnection;

            switch (AstarPath.active.debugMode) {
                case GraphDebugMode.Areas:
                    c = AstarColor.GetAreaColor (node.area);
                    colSet = true;
                    break;
                case GraphDebugMode.Penalty:
                    c = Color.Lerp (AstarColor.ConnectionLowLerp,AstarColor.ConnectionHighLerp, (float)node.penalty / (float)AstarPath.active.debugRoof);
                    colSet = true;
                    break;
                case GraphDebugMode.Tags:
                    c = Mathfx.IntToColor (node.tags,0.5F);
                    colSet = true;
                    break;

                /* Wasn't really usefull
                case GraphDebugMode.Position:
                    float r = Mathf.PingPong (node.position.x/10000F,1F) + Mathf.PingPong (node.position.x/300000F,1F);
                    float g = Mathf.PingPong (node.position.y/10000F,1F) + Mathf.PingPong (node.position.y/200000F,1F);
                    float b = Mathf.PingPong (node.position.z/10000F,1F) + Mathf.PingPong (node.position.z/100000F,1F);

                    c = new Color (r,g,b);
                    break;
                */
            }

            if (!colSet) {
                if (data == null) return AstarColor.NodeConnection;

                NodeRun nodeR = node.GetNodeRun (data);

                if (nodeR == null) return AstarColor.NodeConnection;

                switch (AstarPath.active.debugMode) {
                    case GraphDebugMode.G:
                        //c = Mathfx.IntToColor (node.g,0.5F);
                        c = Color.Lerp (AstarColor.ConnectionLowLerp,AstarColor.ConnectionHighLerp, (float)nodeR.g / (float)AstarPath.active.debugRoof);
                        break;
                    case GraphDebugMode.H:
                        c = Color.Lerp (AstarColor.ConnectionLowLerp,AstarColor.ConnectionHighLerp, (float)nodeR.h / (float)AstarPath.active.debugRoof);
                        break;
                    case GraphDebugMode.F:
                        c = Color.Lerp (AstarColor.ConnectionLowLerp,AstarColor.ConnectionHighLerp, (float)nodeR.f / (float)AstarPath.active.debugRoof);
                        break;
                }
            }
            c.a *= 0.5F;
            return c;
        }
开发者ID:rmkeezer,项目名称:fpsgame,代码行数:64,代码来源:Base.cs

示例3: Suitable

 public override bool Suitable(Node node)
 {
     return node.GetNodeRun(path.runData).pathID == path.pathID && base.Suitable (node);
 }
开发者ID:Anaryu,项目名称:aetherion,代码行数:4,代码来源:FloodPathTracer.cs


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