Exemplo n.º 1
0
 public ChunkDataEntry GetChunk(ChunkDataType type)
 {
     for (int i = 0; i < SubData.Count; i++)
     {
         if (SubData[i].ChunkType == type)
         {
             return(SubData[i]);
         }
     }
     return(null);
 }
Exemplo n.º 2
0
        private bool SetPositionProperty(Vector3Int globalPosition, string name, ChunkDataType dataType,
                                         object positionProperty)
        {
            if (positionProperty != null)
            {
                Vector3Int localPosition = TileToLocalChunkPosition(globalPosition);

                ChunkDataKey positionKey;
                positionKey.position = localPosition;
                positionKey.name     = name;

                ChunkDataValue positionValue;
                positionValue.type = dataType;
                positionValue.data = positionProperty;

                positionProperties[positionKey] = positionValue;
                return(true);
            }

            return(false);
        }