Air nodes
This page uses Vector3 from Unity. The glossary says what each one is.
An air node is a waypoint on a drone’s route. Drones.Nodes() lists them so your mod can find a node id to send a drone to.
Drones the air nodes in the scene
Call Drones.Nodes() to list the air nodes in the scene, and pass a node’s Id to SetTarget.
public static class Drones
{
public static List<AirNodeInfo> Nodes();
}
| Method | Returns | What it does |
|---|---|---|
Nodes() | List<AirNodeInfo> | Every air node in the scene you are in. |
AirNodeInfo a snapshot of one air node
Drones.Nodes() gives you one of these for each node. LinkedNodeIds lists the nodes it connects to, in route order.
public sealed class AirNodeInfo
{
public string Id { get; }
public Vector3 Position { get; }
public List<string> LinkedNodeIds { get; }
}
| Property | Type | What it means |
|---|---|---|
Id | string | Names this node. It is the same kind of id as DroneInfo.Id. |
Position | Vector3 | Where the node is, in world coordinates. |
LinkedNodeIds | List<string> | The ids of the nodes this one links to, in route order. |
Things to know
Nodes()only lists the nodes in the scene you are in, and you can’t change that. A node in another scene is not listed. (It usesFindObjectsByType, so inactive objects are left out.)LinkedNodeIdslists every node this one links to, not just the one the drone will take next. A node with no links gives an empty list. (It is the fullAir_Node.nextNodeslist, with empty entries skipped. The node the game picks next depends onAir_Node.activeNodeIndex.)- The ids match the ones
DroneInfo.TargetNodeIdandSetTargetuse. You can take an id fromNodes()and pass it straight toSetTarget.
Limits
- You can’t change which nodes link to which. The links are set when the map is built, so to move a drone along a different route, send it to a node with
SetTarget. (nextNodesis set in the Unity editor, and the framework has no node-link writer.)