Пример #1
0
        /// <summary>
        /// Adds grid neighbour to node, direction ints should be in [-1, 1]
        /// </summary>
        /// <param name="node"></param>
        /// <param name="x">neighbour x idx</param>
        /// <param name="y">neighbour y idx</param>
        /// <param name="z">neighbour z idx</param>
        private void AddNeighbour(Node node, int x, int y, int z)
        {
            if (x < 0 || x > xSize - 1)
            {
                return;
            }

            if (y < 0 || y > ySize - 1)
            {
                return;
            }

            if (z < 0 || z > zSize - 1)
            {
                return;
            }

            node.AddNeighbourIdentifier(new Vector3(x, y, z));
        }