Skip to content

Commit 96fa7cc

Browse files
committed
Add more clarification to docs
1 parent 98a55a4 commit 96fa7cc

1 file changed

Lines changed: 5 additions & 4 deletions

File tree

Documentation~/README.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
[Unity Package Manager]: https://docs.unity3d.com/Manual/upm-ui.html
12
[Unity Event]: https://docs.unity3d.com/ScriptReference/Events.UnityEvent.html
23
[Samples~]: ../Samples%7E
34
[Simple Events]: ../Samples%7E/SimpleEvents
@@ -7,12 +8,12 @@
78
# Documentation
89

910
## Samples
10-
The documented features can be imported as samples via _Unity Package Manager_ from the [Samples~] directory:
11+
The documented features can be imported as samples via [Unity Package Manager] from the [Samples~] directory. If you get stuck, check the corresponding sample:
1112
<p align="center">
1213
<img src="samples.png"/>
1314
</p>
1415

15-
## Getting Started
16+
## Getting Started (Simple Events)
1617
The simplest use case of _Scriptable Events_ is when you want to notify a system that something happened without providing any context. To do so, you need two elements: a _Simple Scriptable Event_ and a _Simple Scriptable Event Listener_.
1718

1819
First, create a _Simple Scriptable Event_ asset by right-clicking in the project window and selecting _Scriptable Events/Simple Scriptable Event_. You can name the event as you prefer and place it anywhere in your project:
@@ -53,7 +54,7 @@ public class TriggerEvent : MonoBehaviour
5354
}
5455
```
5556

56-
## Passing Arguments
57+
## Passing Arguments (Events With Arguments)
5758
In most situations you'll want to pass an argument when triggering an event. For example, if the player takes damage, you might want to notify your systems with the amount of damage taken.
5859

5960
For such uses cases, this package provides a set of events with commonly used argument types. To create an event asset which accepts an argument, right-click in the project window and select an event from _Scriptable Events/_ menu which has the required type:
@@ -92,7 +93,7 @@ public class TriggerEvent : MonoBehaviour
9293
}
9394
```
9495

95-
## Creating Custom Events
96+
## Creating Custom Events (Custom Events)
9697
In some cases using the built-in argument types is not sufficient. For example, if the player takes damage, you might also want to pass a reference to the object that dealt damage to the player. In this case passing only the damage taken is not enough, you need to pass a `class` argument which contains both of those values. For this you'll need to create a custom event.
9798

9899
To start, create a container `class` for your event data. In this case we'll pass the values needed to change the `Metallic` and `Color` properties of a material:

0 commit comments

Comments
 (0)