Example #1
0
 private void Awake()
 {
     levelButtons = GetComponentsInChildren <LevelMenuButton>();
     for (int y = 0; y < numRows; ++y)
     {
         for (int x = 0; x < numColumns; ++x)
         {
             LevelMenuButton child = GetChild(x, y);
             child.x = x;
             child.y = y;
         }
     }
     previousHorizontals = new Dictionary <int, int>();
     previousVerticals   = new Dictionary <int, int>();
 }
Example #2
0
    public void SelectChild(int x, int y)
    {
        LevelMenuButton currentSelected = GetChild(selectedX, selectedY);

        if (currentSelected != null)
        {
            if (currentSelected.state == LevelMenuButton.State.Pressed)
            {
                return;
            }

            currentSelected.state = LevelMenuButton.State.Idle;
        }

        selectedX            = x;
        selectedY            = y;
        GetChild(x, y).state = LevelMenuButton.State.Hovered;
    }