Skip to content

Latest commit

 

History

History
79 lines (44 loc) · 3.79 KB

File metadata and controls

79 lines (44 loc) · 3.79 KB

Adding A Unity Event Listener

Text Example

Select the `<GameObject>` GameObject from the Unity Hierarchy window and click the `+` symbol in the bottom right corner of the `<Event Name>` event parameter on the `<Component>` component.

Drag and drop the `<GameObject>` GameObject into the event listener box that appears on the `<Event Name>` event parameter on the `<Component>` component that displays `None (Object)`.

<First Image>

Select a function to perform when the `<Event Name>` event is emitted. For this example, select the `<Component> -> <Function>` function (be sure to select `Dynamic <type> - <Function>` for this example) [or] (be sure to select `Static Parameters - <Function(value)>` for this example).

<Second Image>

Markdown output example

Select the <GameObject> GameObject from the Unity Hierarchy window and click the + symbol in the bottom right corner of the <Event Name> event parameter on the <Component> component.

Drag and drop the <GameObject> GameObject into the event listener box that appears on the <Event Name> event parameter on the <Component> component that displays None (Object).

Select a function to perform when the <Event Name> event is emitted. For this example, select the <Component> -> <Function> function (be sure to select Dynamic <type> - <Function> for this example) [or] (be sure to select Static Parameters - <Function(value)> for this example).

Image Example

First Image

![Example Of Set A Unity Event Listener](assets/images/ExampleOfSetAUnityEventListener.png)

Example Of Set A Unity Event Listener

Second Image

![Example Of Choose Function To Run On Event Emit](assets/images/ExampleOfChooseFunctionToRunOnEventEmit.png)

Example Of Choose Function To Run On Event Emit

Final Output

### Step X

Select the `OpacityChangingInteractable -> Interactions.ActionReceiver -> OutputActions -> FloatAction` GameObject from the Unity Hierarchy window and click the `+` symbol in the bottom right corner of the `Value Changed` event parameter on the `Float Action` component.

Drag and drop the `OpacityChangingInteractable -> OpacityChanger` GameObject into the event listener box that appears on the `Value Changed` event parameter on the `Float Action` component that displays `None (Object)`.

![Drag And Drop Opacity Changer Into Value Changed Parameter](assets/images/DragAndDropOpacityChangerIntoValueChangedParameter.png)

Select a function to perform when the `Value Changed` event is emitted. For this example, select the `OpacityChanger -> ChangeOpacity` function (be sure to select `Dynamic float - ChangeOpacity` for this example).

![Select Change Opacity Function](assets/images/SelectChangeOpacityFunction.png)

Markdown output

Step X

Select the OpacityChangingInteractable -> Interactions.ActionReceiver -> OutputActions -> FloatAction GameObject from the Unity Hierarchy window and click the + symbol in the bottom right corner of the Value Changed event parameter on the Float Action component.

Drag and drop the OpacityChangingInteractable -> OpacityChanger GameObject into the event listener box that appears on the Value Changed event parameter on the Float Action component that displays None (Object).

Drag And Drop Opacity Changer Into Value Changed Parameter

Select a function to perform when the Value Changed event is emitted. For this example, select the OpacityChanger -> ChangeOpacity function (be sure to select Dynamic float - ChangeOpacity for this example).

Select Change Opacity Function