예제 #1
0
 public void ChangeVisibility(CubeIndex index, Tile.SelectionStatus visibility)
 {
     if (onVisibilityChanged != null)
     {
         onVisibilityChanged(index, visibility);
     }
 }
예제 #2
0
 public void ChangeSelectionStatus(Tile.SelectionStatus selectionStatus)
 {
     if (selectionStatus == Tile.SelectionStatus.Hovered && !select.IsSelected)
     {
         tile.selectionStatus = Tile.SelectionStatus.Hovered;
         meshRen.material     = hoverMat;
     }
     if (selectionStatus == Tile.SelectionStatus.Selected && select.IsSelected)
     {
         tile.selectionStatus = Tile.SelectionStatus.Selected;
         meshRen.material     = selectedMat;
     }
     if (selectionStatus == Tile.SelectionStatus.Highlighted)
     {
         tile.selectionStatus = Tile.SelectionStatus.Highlighted;
         meshRen.material     = highlightMat;
     }
     if (selectionStatus == Tile.SelectionStatus.Path)
     {
         tile.selectionStatus = Tile.SelectionStatus.Path;
         meshRen.material     = pathMat;
     }
     if (selectionStatus == Tile.SelectionStatus.Default && !select.IsSelected) //
     {
         tile.selectionStatus = Tile.SelectionStatus.Default;
         meshRen.material     = originalMat;
         foreach (var rend in origRendMats)
         {
             rend.Key.GetComponent <MeshRenderer>().materials = rend.Value;
         }
         origRendMats.Clear();
     }
     if (selectionStatus == Tile.SelectionStatus.Fog)
     {
         GetOriginalMaterialArrays();
         tile.selectionStatus = Tile.SelectionStatus.Fog;
         var rends = GetComponentsInChildren <MeshRenderer>();
         for (int i = 0; i < rends.Length; i++)
         {
             var mats = rends[i].materials;
             for (int k = 0; k < mats.Length; k++)
             {
                 mats[k] = discoveredFogMat;
             }
             rends[i].materials = mats;
         }
     }
 }