void OnEnable() { GetComponent <HoverTooltip>().Text = EventAction.Meta.Tooltip; Button.GetComponentInChildren <Text>().text = EventAction.GetType().Name; Button.onClick.AddListener(OnClick); StartCoroutine(UpdateCoroutine()); }
private void load() { AddInternal(content); AutoSizeAxes = Axes.Both; BackgroundColour = Colour4.Transparent; HoverColour = new Colour4(55, 55, 55, 255); Action = () => { events.AddActionToCurrent(Activator.CreateInstance(type.GetType()) as EventAction); actionList.Hide(); }; SpriteText.Text = string.Join(' ', type.Text); }
private void Start() { InteractionName.text = Interaction.GetType().Name; deps = Interaction.GetDependencies(); tooltip = GetComponent <HoverTooltip>(); if (tooltip == null) { tooltip = gameObject.AddComponent <HoverTooltip>(); } Button.onClick.AddListener(OnButtonClicked); InterAvailable(); RebuildTooltip(); wasAvailable = !InterAvailable(); }
void NotifyOfAct(GameObject go, EventAction action) { if (action.Meta.OncePerObject || action.Meta.OnceInCategory) { Markers markers = go.GetComponent <Markers>(); if (markers == null) { markers = go.AddComponent <Markers>(); } if (action.Meta.Category == "ui") { markers.SetUiMarker(action.Meta.OnceInCategory ? action.Meta.Category : action.GetType().Name); } else { markers.SetMarker(action.Meta.OnceInCategory? action.Meta.Category : action.GetType().Name); } } }
private bool ActedThisWayAndShouldNoMore(GameObject go, EventAction action) { if (action.Meta.OncePerObject || action.Meta.OnceInCategory) { Markers markers = go.GetComponent <Markers>(); if (markers != null) { return(markers.HasMarker(action.Meta.OnceInCategory ? action.Meta.Category : action.GetType().Name)); } } return(false); }