public void OnInjectionFinished() { issueImage.style.unityBackgroundImageTintColor = SongIssueUtils.GetColorForIssue(SongIssue); tooltipControl = injector .WithRootVisualElement(VisualElement) .CreateAndInject <TooltipControl>(); tooltipControl.TooltipText = SongIssue.Message; }
private void CreateBindings() { Image.SetBinding(Image.SourceProperty, new Binding("Image") { Source = (BaseModel)CenteredImageModel ?? Model, Mode = BindingMode.OneWay }); Image.SetBinding(MarginProperty, new Binding("FormattedMargin") { Source = Model, Mode = BindingMode.OneWay }); ImageGrid.SetBinding(HeightProperty, new Binding("Height") { Source = Model, Mode = BindingMode.OneWay }); ImageGrid.SetBinding(WidthProperty, new Binding("Width") { Source = Model, Mode = BindingMode.OneWay }); ImageGrid.SetBinding(VisibilityProperty, new Binding("Visibility") { Source = Model, Mode = BindingMode.OneWay }); ImageGrid.SetBinding(RenderTransformProperty, new Binding("Translate") { Source = Model, Mode = BindingMode.OneWay }); ImageGrid.SetBinding(CursorProperty, new Binding("Cursor") { Source = Model, Mode = BindingMode.OneWay }); TooltipControl.SetBinding(ContentProperty, new Binding("Tooltip") { Source = Model, Mode = BindingMode.OneWay }); TooltipControl.SetBinding(VisibilityProperty, new Binding("TooltipVisibility") { Source = Model, Mode = BindingMode.OneWay }); }
void UpdateWaypointInfo(Transform waypoint, bool increase) { GameObject tooltip = waypoint.transform.GetChild(0).gameObject; TooltipControl tooltipInst = tooltip.GetComponent <TooltipControl>(); if (increase) { tooltipInst.IncreaseCount(); } else { tooltipInst.DecreaseCount(); } if (increase && tooltipInst.isOverloaded() && Random.Range(0, 3) > 0) { //If the node is full, the person will move right away //Visual feedback: An "explosion" appears on the head when its full this.timeToWait = 1; transform.GetChild(0).gameObject.SetActive(true); } }