unity-atoms/docs/api/unityatoms.monohooks.md

196 lines
3.7 KiB
Markdown
Raw Normal View History

2019-10-15 19:43:51 -04:00
---
id: unityatoms.monohooks
title: UnityAtoms.MonoHooks
hide_title: true
sidebar_label: UnityAtoms.MonoHooks
---
# Namespace - `UnityAtoms.MonoHooks`
2020-01-23 17:42:09 -05:00
## `OnDestroyHook`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Mono Hook for [`OnDestroy`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnDestroy.html)
2019-10-15 19:43:51 -04:00
---
2020-01-23 17:42:09 -05:00
## `ColliderHook`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Base class for all `MonoHook`s of type `Collider`.
2019-10-15 19:43:51 -04:00
---
2020-01-23 17:42:09 -05:00
## `OnUpdateHook`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Mono Hook for [`Update`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.Update.html)
2019-10-15 19:43:51 -04:00
---
2020-01-23 17:42:09 -05:00
## `OnTrigger2DHook`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Mono Hook for [`OnTriggerEnter2D`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerEnter2D.html), [`OnTriggerExit2D`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerExit2D.html) and [`OnTriggerStay2D`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerStay2D.html)
### Variables
#### `_triggerOnEnter`
Set to true if Event should be triggered on `OnTriggerEnter2D`
2019-10-15 19:43:51 -04:00
---
2020-01-23 17:42:09 -05:00
#### `_triggerOnExit`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Set to true if Event should be triggered on `OnTriggerExit2D`
2019-10-15 19:43:51 -04:00
---
2020-01-23 17:42:09 -05:00
#### `_triggerOnStay`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Set to true if Event should be triggered on `OnTriggerStay2D`
---
## `OnTriggerHook`
Mono Hook for [`OnTriggerEnter`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerEnter.html), [`OnTriggerExit`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerExit.html) and [`OnTriggerStay`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.OnTriggerStay.html)
### Variables
#### `_triggerOnEnter`
Set to true if Event should be triggered on `OnTriggerEnter`
---
#### `_triggerOnExit`
Set to true if Event should be triggered on `OnTriggerExit`
---
#### `_triggerOnStay`
Set to true if Event should be triggered on `OnTriggerStay`
2019-10-15 19:43:51 -04:00
---
## `MonoHook<E1,E2,EV,F>`
#### Type Parameters
- `E1` - Event of type `AtomEvent<EV>`
- `E2` - Event of type `AtomEvent<EV, GameObject>`
- `EV` - Event value type
- `F` - Function type `AtomFunction<GameObject, GameObject>`
Generic base class for all Mono Hooks.
### Variables
#### `Event`
The Event
---
#### `EventWithGameObjectReference`
Event including a GameObject reference.
---
#### `_selectGameObjectReference`
Selector function for the Event `EventWithGameObjectReference`. Makes it possible to for example select the parent GameObject and pass that a long to the `EventWithGameObjectReference`.
---
2020-01-23 17:42:09 -05:00
## `OnLateUpdateHook`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Mono Hook for [`LateUpdate`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.LateUpdate.html)
2019-10-15 19:43:51 -04:00
---
## `OnButtonClickHook`
Mono Hook for On Button Click
---
## `OnFixedUpdateHook`
Mono Hook for [`FixedUpdate`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.FixedUpdate.html)
---
## `OnPointerDownHook`
Mono Hook for `OnPointerDown`
---
2020-01-23 17:42:09 -05:00
## `Collider2DHook`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Base class for all `MonoHook`s of type `Collider2D`.
2019-10-15 19:43:51 -04:00
---
2020-01-23 17:42:09 -05:00
## `OnAwakeHook`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Mono Hook for [`Awake`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.Awake.html).
2019-10-15 19:43:51 -04:00
### Variables
2020-01-23 17:42:09 -05:00
#### `_listener`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Listener
2019-10-15 19:43:51 -04:00
---
2020-02-23 18:59:35 -05:00
#### `_gameObjectListener`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Listener with GameObject reference
2019-10-15 19:43:51 -04:00
---
2020-01-23 17:42:09 -05:00
## `OnStartHook`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Mono Hook for [`Start`](https://docs.unity3d.com/ScriptReference/MonoBehaviour.Start.html)
2019-10-15 19:43:51 -04:00
---
2020-01-23 17:42:09 -05:00
## `VoidHook`
2019-10-15 19:43:51 -04:00
2020-01-23 17:42:09 -05:00
Base class for all `MonoHook`s of type `Void`.
2019-10-15 19:43:51 -04:00
2020-02-23 18:59:35 -05:00
### Variables
2019-10-15 19:43:51 -04:00
2020-02-23 18:59:35 -05:00
#### `_event`
2019-10-15 19:43:51 -04:00
2020-02-23 18:59:35 -05:00
The Event
2019-10-15 19:43:51 -04:00
---
2020-02-23 18:59:35 -05:00
#### `_eventWithGameObjectReference`
2019-10-15 19:43:51 -04:00
2020-02-23 18:59:35 -05:00
Event including a GameObject reference.
2019-10-15 19:43:51 -04:00
---
2020-02-23 18:59:35 -05:00
#### `_selectGameObjectReference`
2019-10-15 19:43:51 -04:00
2020-02-23 18:59:35 -05:00
Selector function for the Event `EventWithGameObjectReference`. Makes it possible to for example select the parent GameObject and pass that a long to the `EventWithGameObjectReference`.
2019-10-15 19:43:51 -04:00
---
2020-02-23 18:59:35 -05:00
## `ColliderGameObjectEvent`
2019-10-15 19:43:51 -04:00
2020-02-23 18:59:35 -05:00
Event x 2 of type `Collider` and `GameObject`. Inherits from `AtomEvent<Collider, GameObject>`.
2019-10-15 19:43:51 -04:00
---
2020-02-23 18:59:35 -05:00
## `Collider2DGameObjectEvent`
2019-10-15 19:43:51 -04:00
2020-02-23 18:59:35 -05:00
Event x 2 of type `Collider2D` and `GameObject`. Inherits from `AtomEvent<Collider2D, GameObject>`.
2019-10-15 19:43:51 -04:00
---