void OnEnable()
 {
     GetComponent <HoverTooltip>().Text          = EventAction.Meta.Tooltip;
     Button.GetComponentInChildren <Text>().text = EventAction.GetType().Name;
     Button.onClick.AddListener(OnClick);
     StartCoroutine(UpdateCoroutine());
 }
Exemplo n.º 2
0
 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);
 }
Exemplo n.º 3
0
 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();
 }
Exemplo n.º 4
0
 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);
         }
     }
 }
Exemplo n.º 5
0
    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);
    }