private void OnRecvFindPath(IChannel channel, Message message) { SFindPath msg = message as SFindPath; foreach (V3 p in msg.path) { Vector3 v = new Vector3(p.x, p.y, p.z); Debug.DrawLine(v, v + Vector3.up * 10, Color.red, 60); } }
private void OnRecvFindPath(IChannel channel, Message message) { CFindPath request = message as CFindPath; Player player = (Player)channel.GetContent(); V3 start = player.GetPosition(); Point3d end = new Point3d((float)request.pos.x, (float)request.pos.y, (float)request.pos.z); LinkedList <Point3d> path = new LinkedList <Point3d>(); if (player.GetScene().FindPath(player.Position, end, path)) { SFindPath response = new SFindPath(); foreach (Point3d point in path) { V3 v3 = new V3((float)point.X, (float)point.Y, (float)point.Z); response.path.Add(v3); } channel.Send(response); } }