當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。