Пример #1
0
        public AvailableTowersUiView(ButtonManager buttonManager, TowerSelectorController towerSelector, Rectangle backgroundRect)
        {
            this.buttonManager = buttonManager;
            BackgroundRect     = backgroundRect;
            ButtonsOffset      = backgroundRect.Location.ToVector2();

            Buttons = new List <Button>();
            CreateButtons(towerSelector);

            buttonManager.AddButtons(Buttons);

            ViewGroupId = new HashSet <int>();
            Enabled     = true;
        }
Пример #2
0
        public SelectMapController(AvailableMapsView mapsView, ButtonManager buttonManager)
        {
            this.mapsView      = mapsView;
            this.buttonManager = buttonManager;

            buttons = new List <Button>();
            for (int i = 0; i < MapManager.TotalLoadedMaps; i++)
            {
                buttons.Add(new Button(Vector2.Zero, mapsView.ThumbnailSize.ToVector2())
                {
                    AttachedObject = i,
                    Visible        = false
                });
                buttons[i].OnClicked += OnButtonClicked;
            }
            buttonManager.AddButtons(buttons);

            ControllerGroupId = new HashSet <int>();
            Enabled           = true;
        }