public void Load(NavTreeReader reader) { // read position and size position = reader.ReadVector3(); size = reader.ReadFloat(); // read obstructed status obstructed = reader.ReadBool(); isStatic = reader.ReadBool(); containsStatic = reader.ReadBool(); // Load path int pathLength = reader.ReadInt(); path = new int[pathLength]; for (int i = 0; i < pathLength; i++) { path[i] = reader.ReadInt(); } bool hasChildren = reader.ReadBool(); if (hasChildren) { children = new SpatialNode[8]; for (int i = 0; i < 8; i++) { children[i] = new SpatialNode(reader, this, tree); } } }
public NavTree(float maxNodeSize, int maxTreeDepth, Vector3 position, NavTreeReader reader) { this.maxNodeSize = maxNodeSize; this.maxTreeDepth = maxTreeDepth; this.position = position; Load(reader); NavTreeManager.instance.AddNavTree(this); }
public SpatialNode(NavTreeReader reader, SpatialNode parent, NavTree tree) { this.tree = tree; if (parent != null) { Load(reader, parent); } else { Load(reader); } InitializeAncestors(); }
public void Load(NavTreeReader reader) { root = new SpatialNode(reader, null, this); }
public void Load(NavTreeReader reader, SpatialNode parent) { this.parent = parent; Load(reader); }