コード例 #1
0
 public override void setNextNode(PathAI pathAi)
 {
     print(state);
     if (state == TrafficLight.RED)
     {
         listeners.Add(pathAi);
         pathAi.node = null;
         pathAi.setTarget();
     }
     else
     {
         base.setNextNode(pathAi);
     }
 }
コード例 #2
0
ファイル: WayPoint.cs プロジェクト: HalfPixelStudios/TADS
    public virtual void setNextNode(PathAI pathAi)
    {
        var c = connections;

        if (pathAi.prevNode != null && c.Count > 1)
        {
            print(pathAi.prevNode);
            c = connections.FindAll(node => node.transform.position != pathAi.prevNode.transform.position);
        }

        pathAi.prevNode = pathAi.node;
        print(c.Count);
        pathAi.node = c[Random.Range(0, c.Count)];
        pathAi.setTarget();
    }