示例#1
0
        public Matrix3D(int ox, int oy, int oz, int sx, int sy, int sz, T[] array = null)
        {
            this.cube = new CoordCube(ox, oy, oz, sx, sy, sz);
            count     = cube.size.x * cube.size.y * cube.size.z;

            if (array != null && array.Length < count)
            {
                Debug.LogError("Array length: " + array.Length + " is lower then matrix capacity: " + count);
            }
            if (array != null && array.Length >= count)
            {
                this.array = array;
            }
            else
            {
                this.array = new T[count];
            }
        }
示例#2
0
        public Matrix3D(CoordDir offset, CoordDir size, T[] array = null)
        {
            cube  = new CoordCube(offset, size);
            count = cube.size.x * cube.size.y * cube.size.z;

            if (array != null && array.Length < count)
            {
                Debug.LogError("Array length: " + array.Length + " is lower then matrix capacity: " + count);
            }
            if (array != null && array.Length >= count)
            {
                this.array = array;
            }
            else
            {
                this.array = new T[count];
            }
        }