Beispiel #1
0
 public void flush()
 {
     if (parent.player != null && parent.player.name == "player" && !parent.getVisible())
     {
         setTranslucent();
         transform.position = new Vector3(transform.position.x,
                                          transform.position.y, parent.transform.position.z - 0.5f);
         return;
     }
     setVisible(parent.getVisible());
     transform.position = new Vector3(transform.position.x,
                                      transform.position.y, parent.transform.position.z - 0.5f);
 }
Beispiel #2
0
 public int[] getLimits(int index, bool targetColor)
 {
     int[] limits = { 0, 14 };
     if (index > 0)
     {
         for (int i = index - 1; i >= 0; i--)
         {
             CardS t = getCard(i);
             if (t.getVisible())
             {
                 if (t.getColor() == targetColor)
                 {
                     limits[0] = t.getValue() + 1;
                 }
                 else
                 {
                     limits[0] = t.getValue();
                 }
                 break;
             }
         }
     }
     if (index < cards.Count - 1)
     {
         for (int i = index + 1; i < cards.Count; i++)
         {
             CardS t = getCard(i);
             if (t.getVisible())
             {
                 if (t.getColor() == targetColor)
                 {
                     limits[1] = t.getValue();
                 }
                 else
                 {
                     limits[1] = t.getValue() + 1;
                 }
                 break;
             }
         }
     }
     return(limits);
 }