public static void OpenBar(PanelButtonType buttonID) { isActive = true; thisGameObject.SetActive(true); countText.gameObject.SetActive(true); countText.text = ""; progressImage.color = GameManager.HumanPlayer.color; if (buttonID == PanelButtonType.UnitsMenu) { backgroundImage.rectTransform.anchorMin = new Vector2(0.35f, 0.74f); backgroundImage.rectTransform.anchorMax = new Vector2(0.65f, 0.76f); } else if (buttonID == PanelButtonType.LocalUpgradesButton) { backgroundImage.rectTransform.anchorMin = new Vector2(0.15f, 0.6f); backgroundImage.rectTransform.anchorMax = new Vector2(0.85f, 0.65f); countText.gameObject.SetActive(false); } else { backgroundImage.rectTransform.anchorMin = new Vector2(0.35f, 0.65f); backgroundImage.rectTransform.anchorMax = new Vector2(0.65f, 0.67f); } progressImage.rectTransform.anchorMax = new Vector2(0f, 1f); float countTextWidth = 0.1f * GameManager.panelWidth * Screen.width; float countTextHeight = 0.06f * Screen.height; countText.rectTransform.sizeDelta = new Vector2(countTextWidth, countTextHeight); float xTextPos = Screen.width * GameManager.panelWidth * (backgroundImage.rectTransform.anchorMax.x - backgroundImage.rectTransform.anchorMin.x) + countTextWidth; float yTextPos = Screen.height * ((backgroundImage.rectTransform.anchorMax.y - backgroundImage.rectTransform.anchorMin.y) / 2f); countText.rectTransform.anchoredPosition = new Vector2(xTextPos, yTextPos); }
public PanelButton(object parent, PanelButtonType buttonType, PanelButtonStyle buttonStyle, EventHandler clickHandler) : base(parent) { this.Parent = parent; this.Type = buttonType; this.Style = buttonStyle; this.clickEventHandler = clickHandler; }
public PanelButton(object parent, PanelButtonType buttonType, PanelButtonStyle buttonStyle, EventHandler clickHandler) : base(parent) { Parent = parent; Type = buttonType; Style = buttonStyle; clickEventHandler = clickHandler; }
public PanelButton(Game game, PanelButtonType type):base(game) { buttonType = type; switch (type) { case PanelButtonType.UpArrow: visual = new Sprite(game, GraphicsCollection.GetPack("building-up")); break; case PanelButtonType.DownArrow: visual = new Sprite(game, GraphicsCollection.GetPack("building-down")); break; case PanelButtonType.Minimize: visual = new Sprite(game, GraphicsCollection.GetPack("building-minimize")); break; case PanelButtonType.TimeDownArrow: visual = new Sprite(game, GraphicsCollection.GetPack("time-panel-arrowdown")); break; case PanelButtonType.TimeUpArrow: visual = new Sprite(game, GraphicsCollection.GetPack("time-panel-arrowup")); break; case PanelButtonType.TimeMinimize: visual = new Sprite(game, GraphicsCollection.GetPack("time-panel-minimize")); break; case PanelButtonType.TimeLeft: visual = new Sprite(game, GraphicsCollection.GetPack("time-bar-leftarrow")); break; case PanelButtonType.TimeRight: visual = new Sprite(game, GraphicsCollection.GetPack("time-bar-rightarrow")); break; case PanelButtonType.TimeTravelButton: visual = new Sprite(game, GraphicsCollection.GetPack("time-panel-button-travel")); break; case PanelButtonType.ResourcesMinimize: visual = new Sprite(game, GraphicsCollection.GetPack("left-menu-minimize")); break; case PanelButtonType.ResourcesAlert: visual = new Sprite(game, GraphicsCollection.GetPack("left-menu-button-alert")); break; case PanelButtonType.ResourcesControl: visual = new Sprite(game, GraphicsCollection.GetPack("left-menu-button-control")); break; case PanelButtonType.ResourcesExit: visual = new Sprite(game, GraphicsCollection.GetPack("left-menu-button-exit")); break; case PanelButtonType.ResourcesMission: visual = new Sprite(game, GraphicsCollection.GetPack("left-menu-button-mission")); break; case PanelButtonType.ResourcesSave: visual = new Sprite(game, GraphicsCollection.GetPack("left-menu-button-save")); break; case PanelButtonType.YearReset: visual = new Sprite(game, GraphicsCollection.GetPack("year-panel-reset")); break; } AddChild(visual); }
public static void Enable(PanelButtonType panelID) { GameManager.HumanPlayer.userInput.Deselect(); GameManager.HumanPlayer.userInput.enabled = false; GameManager.Hud.SetActive(false); mainCamGameObject.SetActive(false); thisCamera.gameObject.SetActive(true); activePanelID = panelID; if (activePanelID != PanelButtonType.PopulationsButton) { panelDick[activePanelID].gameObject.SetActive(true); } }
public PanelButton(object parent, PanelButtonType type, EventHandler clickHandler) : this(parent, type, PanelButtonStyle.Rectangle, clickHandler) { }
public void ClosePanelButton(PanelButtonType butt) { PanelDict [butt].SetActive(false); }
public void OpenPanelButton(PanelButtonType butt) { PanelDict [butt].SetActive(true); }