private void OnApplicationFocus(bool focus)
 {
     if (focus)
     {
         EventBus.Trigger(EventHooks.OnApplicationFocus);
     }
     else
     {
         EventBus.Trigger(EventHooks.OnApplicationLostFocus);
     }
 }
 public void AddGUIListeners()
 {
     GetComponent <Button>()?.onClick?.AddListener(() => EventBus.Trigger(EventHooks.OnButtonClick, gameObject));
     GetComponent <Toggle>()?.onValueChanged?.AddListener((value) => EventBus.Trigger(EventHooks.OnToggleValueChanged, gameObject, value));
     GetComponent <Slider>()?.onValueChanged?.AddListener((value) => EventBus.Trigger(EventHooks.OnSliderValueChanged, gameObject, value));
     GetComponent <Scrollbar>()?.onValueChanged?.AddListener((value) => EventBus.Trigger(EventHooks.OnScrollbarValueChanged, gameObject, value));
     GetComponent <Dropdown>()?.onValueChanged?.AddListener((value) => EventBus.Trigger(EventHooks.OnDropdownValueChanged, gameObject, value));
     GetComponent <InputField>()?.onValueChanged?.AddListener((value) => EventBus.Trigger(EventHooks.OnInputFieldValueChanged, gameObject, value));
     GetComponent <InputField>()?.onEndEdit?.AddListener((value) => EventBus.Trigger(EventHooks.OnInputFieldEndEdit, gameObject, value));
     GetComponent <ScrollRect>()?.onValueChanged?.AddListener((value) => EventBus.Trigger(EventHooks.OnScrollRectValueChanged, gameObject, value));
 }
 private void OnApplicationPause(bool paused)
 {
     if (paused)
     {
         EventBus.Trigger(EventHooks.OnApplicationPause);
     }
     else
     {
         EventBus.Trigger(EventHooks.OnApplicationResume);
     }
 }
 private void OnMouseUp()
 {
     EventBus.Trigger(EventHooks.OnMouseUp, gameObject);
 }
 private void OnGUI()
 {
     EventBus.Trigger(EventHooks.OnGUI);
 }
 private void Start()
 {
     GetComponent <Button>()?.onClick
     ?.AddListener(() => EventBus.Trigger(EventHooks.OnButtonClick, gameObject));
 }
Esempio n. 7
0
 private void OnTriggerStay(Collider other)
 {
     EventBus.Trigger(EventHooks.OnTriggerStay, gameObject, other);
 }
Esempio n. 8
0
 public void OnSubmit(BaseEventData eventData)
 {
     EventBus.Trigger(EventHooks.OnSubmit, gameObject, eventData);
 }
Esempio n. 9
0
 private void OnCollisionStay2D(Collision2D collision)
 {
     EventBus.Trigger(EventHooks.OnCollisionStay2D, gameObject, collision);
 }
Esempio n. 10
0
 private void OnParticleCollision(GameObject other)
 {
     EventBus.Trigger(EventHooks.OnParticleCollision, gameObject, other);
 }
 private void Start()
 {
     GetComponent <InputField>()?.onValueChanged?.AddListener((value) =>
                                                              EventBus.Trigger(EventHooks.OnInputFieldValueChanged, gameObject, value));
 }
 private void OnJointBreak(float breakForce)
 {
     EventBus.Trigger(EventHooks.OnJointBreak, gameObject, breakForce);
 }
 private void OnJointBreak2D(Joint2D brokenJoint)
 {
     EventBus.Trigger(EventHooks.OnJointBreak2D, gameObject, brokenJoint);
 }
 private void OnControllerColliderHit(ControllerColliderHit hit)
 {
     EventBus.Trigger(EventHooks.OnControllerColliderHit, gameObject, hit);
 }
 private void OnCollisionStay(Collision collision)
 {
     EventBus.Trigger(EventHooks.OnCollisionStay, gameObject, collision);;
 }
 private void OnBecameVisible()
 {
     EventBus.Trigger(EventHooks.OnBecameVisible, gameObject);
 }
 public void OnMove(AxisEventData eventData)
 {
     EventBus.Trigger(EventHooks.OnMove, gameObject, eventData);
 }
Esempio n. 18
0
 private void Start()
 {
     GetComponent <Scrollbar>()?.onValueChanged?.AddListener((value) =>
                                                             EventBus.Trigger(EventHooks.OnScrollbarValueChanged, gameObject, value));
 }
 private void OnApplicationQuit()
 {
     EventBus.Trigger(EventHooks.OnApplicationQuit);
 }
 private void OnMouseUpAsButton()
 {
     EventBus.Trigger(EventHooks.OnMouseUpAsButton, gameObject);
 }
Esempio n. 21
0
 public void OnDrop(PointerEventData eventData)
 {
     EventBus.Trigger(EventHooks.OnDrop, gameObject, eventData);
 }
 private void OnTransformParentChanged()
 {
     EventBus.Trigger(EventHooks.OnTransformParentChanged, gameObject);
 }
 private void Start() => GetComponent <Toggle>()?.onValueChanged?.AddListener((value) =>
                                                                              EventBus.Trigger(EventHooks.OnToggleValueChanged, gameObject, value));
 public void OnEndDrag(PointerEventData eventData)
 {
     EventBus.Trigger(EventHooks.OnEndDrag, gameObject, eventData);
 }
 public void OnCancel(BaseEventData eventData)
 {
     EventBus.Trigger(EventHooks.OnCancel, gameObject, eventData);
 }
Esempio n. 26
0
 private void OnCollisionExit(Collision collision)
 {
     EventBus.Trigger(EventHooks.OnCollisionExit, gameObject, collision);
 }
 public void OnPointerClick(PointerEventData eventData)
 {
     EventBus.Trigger(EventHooks.OnPointerClick, gameObject, eventData);
 }
 public void OnScroll(PointerEventData eventData)
 {
     EventBus.Trigger(EventHooks.OnScroll, gameObject, eventData);
 }
 private void OnTriggerExit2D(Collider2D other)
 {
     EventBus.Trigger(EventHooks.OnTriggerExit2D, gameObject, other);
 }
Esempio n. 30
0
 protected virtual void TriggerRegisteredEvent <TArgs>(EventHook hook, TArgs args)
 {
     EventBus.Trigger(hook, args);
 }