예제 #1
0
        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);
                }
            }
        }
예제 #2
0
        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);
        }
예제 #3
0
 public SpatialNode(NavTreeReader reader, SpatialNode parent, NavTree tree)
 {
     this.tree = tree;
     if (parent != null)
     {
         Load(reader, parent);
     }
     else
     {
         Load(reader);
     }
     InitializeAncestors();
 }
예제 #4
0
 public void Load(NavTreeReader reader)
 {
     root = new SpatialNode(reader, null, this);
 }
예제 #5
0
 public void Load(NavTreeReader reader, SpatialNode parent)
 {
     this.parent = parent;
     Load(reader);
 }