Advertisement
CassataGames

Untitled

Sep 1st, 2014
346
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.36 KB | None | 0 0
  1.     public EditorGlobals GlobalAccess;
  2.  
  3.     public GameObject XY;
  4.  
  5.     public HoverHighlight[] XList;
  6.     public HoverHighlight[] YList;
  7.    
  8.     // Update is called once per frame
  9.     void Update ()
  10.     {
  11.         foreach (HoverHighlight Highlight in XList)
  12.         {
  13.             Highlight.IsOrientation = false;
  14.             Highlight.IsSize = false;
  15.         }
  16.         foreach (HoverHighlight Highlight in YList)
  17.         {
  18.             Highlight.IsOrientation = false;
  19.             Highlight.IsSize = false;
  20.         }
  21.  
  22.         switch(GlobalAccess.OrientationSelected)
  23.         {
  24.             case EditorGlobals.Orientation.Horizontal:
  25.                 foreach (HoverHighlight Highlight in XList)
  26.                     Highlight.IsOrientation = true;
  27.                 break;
  28.             case EditorGlobals.Orientation.Vertical:
  29.                 foreach (HoverHighlight Highlight in YList)
  30.                     Highlight.IsOrientation = true;
  31.                 break;
  32.         }
  33.  
  34.         if (GlobalAccess.SizeSelected > 5)
  35.             GlobalAccess.SizeSelected = 5;
  36.         if (GlobalAccess.SizeSelected < 1)
  37.             GlobalAccess.SizeSelected = 1;
  38.  
  39.         int index = 0;
  40.         while (index < GlobalAccess.SizeSelected - 1)
  41.         {            
  42.             XList[index].IsSize = true;
  43.             YList[index].IsSize = true;
  44.             index++;
  45.         }
  46.     }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement