예제 #1
0
 public BlockStructure(int row, int col, BLOCKSIZE size, Color color, bool[,] serializedMatrix)
 {
     Rows       = row;
     Cols       = col;
     matrix     = DeserializeMatrix(serializedMatrix);
     BlockSize  = size;
     BlockColor = color;
 }
예제 #2
0
 public BlockStructure(int row, int col, BLOCKSIZE size, Color color)
 {
     Rows       = row;
     Cols       = col;
     matrix     = new BlockPart[row, col];
     BlockSize  = size;
     BlockColor = color;
 }
 public void ChangeBlockSize()
 {
     if (currentBlocksize == BLOCKSIZE.NORMAL)
     {
         currentBlocksize = BLOCKSIZE.FLAT;
     }
     else
     {
         currentBlocksize = BLOCKSIZE.NORMAL;
     }
 }
예제 #4
0
 public BlockSave(GameObject block)
 {
     guid            = block.GetComponent <BlockCommunication>().Guid;
     position        = block.transform.position;
     rotation        = block.transform.rotation;
     matrix          = ConvertToBoolMatrix(block.GetComponent <BlockGeometryScript>().blockStructure);
     connectedBlocks = GetConnectedBlocks(block.GetComponent <BlockCommunication>());
     Rows            = block.GetComponent <BlockGeometryScript>().blockStructure.RowsCropped;
     Cols            = block.GetComponent <BlockGeometryScript>().blockStructure.ColsCropped;
     color           = block.GetComponent <MeshRenderer>().material.color;
     blockSize       = block.GetComponent <BlockGeometryScript>().blockStructure.BlockSize;
     timeStamp       = GameObject.FindGameObjectWithTag("BlockManager").GetComponent <BlockManager>().GetTimeStampByGuid(guid);
 }