예제 #1
0
        public bool ConnectTo(Vector3 from, Vector3 to, float cost)
        {
            string FromKey = Node.GetKey(from);
            string ToKey   = Node.GetKey(to);

            if (!Nodes.TryGetValue(FromKey, out Node From))
            {
                return(false);
            }
            if (!Nodes.TryGetValue(ToKey, out Node To))
            {
                return(false);
            }

            From.ConnectTo(To, cost);

            Unused.Remove(From);
            Unused.Remove(To);

            return(true);
        }
 /// <summary>
 /// Connect From and To
 /// </summary>
 public void Connect()
 {
     From.ConnectTo(To);
 }