Exemplo n.º 1
0
 /// <summary>
 /// Represents the spaces with voxel meshes
 /// </summary>
 protected virtual void DrawSpaces()
 {
     foreach (var space in MainGrid.Spaces)
     {
         if (!space.IsSpare)
         {
             Color color;
             Color black = Color.black;
             Color white = Color.white;
             Color acid  = new Color(0.85f, 1.0f, 0.0f, 0.70f);
             if (space.Reconfigure)
             {
                 if (space != _selectedSpace)
                 {
                     color = acid;
                 }
                 else
                 {
                     color = acid;
                 }
             }
             else
             {
                 if (space != _selectedSpace)
                 {
                     color = black;
                 }
                 else
                 {
                     color = black;
                 }
             }
             PP_Drawing.DrawSpaceBoundary(space, MainGrid, color, transform.position);
         }
     }
 }
Exemplo n.º 2
0
    /// <summary>
    /// Modified the display of the spaces
    /// </summary>
    protected override void DrawSpaces()
    {
        foreach (var space in MainGrid.Spaces)
        {
            if (!space.IsSpare)
            {
                Color color;
                Color acid = new Color(0.85f, 1.0f, 0.0f, 0.85f);
                Color grey = new Color(0f, 0f, 0f, 0.25f);

                if (space.Reconfigure)
                {
                    if (space != _selectedSpace)
                    {
                        color = acid;
                    }
                    else
                    {
                        color = acid;
                    }
                }
                else
                {
                    if (space != _selectedSpace)
                    {
                        color = grey;
                    }
                    else
                    {
                        color = grey;
                    }
                }
                PP_Drawing.DrawSpaceSurface(space, MainGrid, color, transform.position);
            }
        }
    }
Exemplo n.º 3
0
 /// <summary>
 /// Draws the current VoxelGrid state with mesh voxels
 /// </summary>
 protected virtual void DrawState()
 {
     for (int x = 0; x < _gridSize.x; x++)
     {
         for (int y = 0; y < _gridSize.y; y++)
         {
             for (int z = 0; z < _gridSize.z; z++)
             {
                 Vector3 index = new Vector3(x + 0.5f, y + 0.5f, z + 0.5f) * _voxelSize;
                 //Vector3 index = new Vector3(x , y , z) * _voxelSize;
                 if (MainGrid.Voxels[x, y, z].IsOccupied)
                 {
                     for (int i = 0; i < 8; i++)
                     {
                         var voxel = MainGrid.Voxels[x, y, z];
                         if (voxel.Part.Type == PartType.Configurable)
                         {
                             //PP_Drawing.DrawConfigurable(transform.position + _grid.Voxels[x, y, z].Center + new Vector3(0, (i + 1) * _voxelSize, 0), _grid.VoxelSize, 1);
                             PP_Drawing.DrawConfigurable(transform.position + index + new Vector3(0, (i + 1) * _voxelSize, 0), MainGrid.VoxelSize, Color.black);
                         }
                         else
                         {
                             //PP_Drawing.DrawCube(transform.position +  _grid.Voxels[x, y, z].Center + new Vector3(0, (i + 1) * _voxelSize, 0), _grid.VoxelSize, 1);
                             PP_Drawing.DrawCube(transform.position + index + new Vector3(0, (i + 1) * _voxelSize, 0), MainGrid.VoxelSize, 1);
                         }
                     }
                 }
                 if (MainGrid.Voxels[x, y, z].IsActive)
                 {
                     //PP_Drawing.DrawCube(transform.position + _grid.Voxels[x, y, z].Center, _grid.VoxelSize, 0);
                     PP_Drawing.DrawCube(transform.position + index, MainGrid.VoxelSize, Color.grey);
                 }
             }
         }
     }
 }