public override void Awake() { size = new Vector2(5, 5); anchor = UIAnchorStyle.Top; helpBg = AddUIComponent <UIPanel>(); helpBg.backgroundSprite = "GenericPanel"; helpBg.color = new Color32(0, 0, 120, 200); helpBg.area = new Vector4(10, 65, 230, 70); usageText = helpBg.AddUIComponent <UILabel>(); usageText.relativePosition = new Vector2(5, 5); usageText.textScale = 0.6f; usageText.text = "Left Click to see all Trafic\n" + "Right Click to see traffic for one direction\n" + "Shift + Right Click for the other direction\n" + "Hover over other roads to see how much is \n" + "going through that location.\n"; reportBreakDown = AddUIComponent <BreakdownPanel>(); reportBreakDown.title.text = "Selected"; reportBreakDown.title.tooltip = "A breakdown of all traffic going through the selected road segement"; reportBreakDown.isVisible = false; reportBreakDown.relativePosition = new Vector2(10, 150); reportBreakDown.eventHighlightType += (String s) => { if (eventHighlightType != null) { eventHighlightType(s); } }; highlightBreakDown = AddUIComponent <BreakdownPanel>(); highlightBreakDown.title.text = "...highlighted"; highlightBreakDown.isVisible = false; highlightBreakDown.relativePosition = new Vector2(220, 150); base.Awake(); }
public override void Awake() { size = new Vector2(5, 5); anchor = UIAnchorStyle.Top; helpBg = AddUIComponent<UIPanel>(); helpBg.backgroundSprite = "GenericPanel"; helpBg.color = new Color32(0, 0, 120, 200); helpBg.area = new Vector4(10, 65, 230, 70); usageText = helpBg.AddUIComponent<UILabel>(); usageText.relativePosition = new Vector2(5, 5); usageText.textScale = 0.6f; usageText.text = "Left Click to see all Trafic\n" + "Right Click to see traffic for one direction\n" + "Shift + Right Click for the other direction\n" + "Hover over other roads to see how much is \n" + "going through that location.\n"; reportBreakDown = AddUIComponent<BreakdownPanel>(); reportBreakDown.title.text = "Selected"; reportBreakDown.title.tooltip = "A breakdown of all traffic going through the selected road segement"; reportBreakDown.isVisible = false; reportBreakDown.relativePosition = new Vector2(10, 150); reportBreakDown.eventHighlightType += (String s) => { if (eventHighlightType != null) eventHighlightType(s); }; highlightBreakDown = AddUIComponent<BreakdownPanel>(); highlightBreakDown.title.text = "...highlighted"; highlightBreakDown.isVisible = false; highlightBreakDown.relativePosition = new Vector2(220, 150); base.Awake(); }