Exemplo n.º 1
0
    // Use this for initialization
    void Start()
    {
        buttonCount  = 0;
        buttonHeight = roomButtonPrefab.GetComponent <RectTransform> ()
                       .rect.height;

        // For debugging
        AddButton("hello");
        AddButton("hello");
        AddButton("hello");
    }
Exemplo n.º 2
0
    /**
     * Instantiate a button and
     */
    private void AddButton(string text)
    {
        RoomButton button = Instantiate <RoomButton> (roomButtonPrefab);

        button.transform.SetParent(transform);

        // Set where the button is and the text it displays
        SetButtonPos(button.GetComponent <RectTransform> ());
        buttonCount += 1;
        SetButtonText(button, text);

        button.AddAction(OnRoomButtonPressed);
    }
Exemplo n.º 3
0
 public void MoveToRoomPanel(RoomButton roomButton)
 {
     roomButton.GetComponent <RectTransform>().SetParent(roomPanel);
 }