Ejemplo n.º 1
0
        private bool Send(ButtonEvent.Event[] evs, Vector2 pos, Vector2 vct)
        {
            bool flag = false;

            if (evs != null)
            {
                for (int index = 0; index < evs.Length; ++index)
                {
                    ButtonEvent.Event ev = evs[index];
                    if (!string.IsNullOrEmpty(ev.eventName) && this.isInteractable)
                    {
                        this.PlaySe(ev);
                        SerializeValueList serializeValueList = new SerializeValueList(ev.valueList);
                        serializeValueList.AddField("_self", ((Component)this).get_gameObject());
                        serializeValueList.AddField("_pos", pos);
                        serializeValueList.AddField("_vct", vct);
                        if (ev.ignoreLock)
                        {
                            ButtonEvent.ForceInvoke(ev.eventName, (object)serializeValueList);
                        }
                        else
                        {
                            ButtonEvent.Invoke(ev.eventName, (object)serializeValueList);
                        }
                        flag = true;
                    }
                }
            }
            return(flag);
        }
Ejemplo n.º 2
0
        private bool SendHold(EventTriggerType trigger, Vector2 pos)
        {
            bool flag = false;

            ButtonEvent.Event[] holdEvents = this.GetHoldEvents(trigger);
            if (holdEvents != null)
            {
                for (int index = 0; index < holdEvents.Length; ++index)
                {
                    ButtonEvent.Event ev = holdEvents[index];
                    if (ev != null && !string.IsNullOrEmpty(ev.eventName) && this.isInteractable)
                    {
                        this.PlaySe(ev);
                        SerializeValueList serializeValueList = new SerializeValueList(ev.valueList);
                        serializeValueList.AddField("_self", ((Component)this).get_gameObject());
                        serializeValueList.AddField("_pos", pos);
                        if (ev.ignoreLock)
                        {
                            ButtonEvent.ForceInvoke(ev.eventName, (object)serializeValueList);
                        }
                        else
                        {
                            ButtonEvent.Invoke(ev.eventName, (object)serializeValueList);
                        }
                        flag = true;
                    }
                }
            }
            return(flag);
        }
 public override void OnActivate(int pinID)
 {
     if (pinID != 100 || string.IsNullOrEmpty(this.EventName))
     {
         return;
     }
     if (this.Force)
     {
         ButtonEvent.ForceInvoke(this.EventName, (object)this.Value);
     }
     else
     {
         ButtonEvent.Invoke(this.EventName, (object)this.Value);
     }
     this.ActivateOutputLinks(1);
 }