Skip to content

Commit 7e05140

Browse files
committed
Reword docs
1 parent 96fa7cc commit 7e05140

1 file changed

Lines changed: 14 additions & 14 deletions

File tree

Documentation~/README.md

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ The documented features can be imported as samples via [Unity Package Manager] f
1414
</p>
1515

1616
## Getting Started (Simple Events)
17-
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_.
17+
The simplest use case of _Scriptable Events_ is when you need 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_.
1818

19-
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:
19+
First, create a _Simple Scriptable Event_ asset by right-clicking in the project window and selecting _Create/Scriptable Events/Simple Scriptable Event_. You can name the event as you prefer and place it anywhere in your project:
2020
<p align="center">
2121
<img src="simple-scriptable-event.png"/>
2222
</p>
@@ -26,15 +26,15 @@ Next, select a _GameObject_ in the scene and add a _Simple Scriptable Event List
2626
<img src="simple-scriptable-event-listener.png"/>
2727
</p>
2828

29-
Once you've added a listener, insert your event asset into the _Scriptable Event_ field (1). In the _On Raised_ [Unity Event] field (2), insert the methods you'd like to be triggered by the event. For example, if you wanted to change a color of an object, your setup might look like the following as seen in the _Simple Events_ sample:
29+
Once you've added a listener, insert your event asset into the _Scriptable Event_ field (1). In the _On Raised_ [Unity Event] field (2) add the methods you'd like to be triggered by the event. For example, if you need to change a color of an object, your setup might look like the following as seen in the _Simple Events_ sample:
3030
<p align="center">
3131
<img src="simple-scriptable-event-sample.png"/>
3232
</p>
3333

34-
Now that you have your listener ready, you need to trigger the event. This can be done from a [Unity Event] by calling `SimpleScriptableEvent.Raise` method or by selecting the event asset and clicking the _Raise_ button when the game is running:
34+
Now that you have your listener ready, you need to trigger the event. This can be done from a [Unity Event] by calling `SimpleScriptableEvent.Raise` method or by selecting the event asset and clicking the _Raise_ button during runtime:
3535
<p align="center">
36-
<img hspace="2%" width="45%" src="simple-scriptable-event-raise-unity-event.png"/>
37-
<img hspace="2%" width="45%" src="simple-scriptable-event-raise.png"/>
36+
<img hspace="2%" width="40%" src="simple-scriptable-event-raise-unity-event.png"/>
37+
<img hspace="2%" width="40%" src="simple-scriptable-event-raise.png"/>
3838
</p>
3939

4040
Alternatively you can trigger the event via code:
@@ -55,17 +55,17 @@ public class TriggerEvent : MonoBehaviour
5555
```
5656

5757
## Passing Arguments (Events With Arguments)
58-
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.
58+
In some situations might need to pass an argument when triggering an event. For example, if the player takes damage, you might need to notify your systems with the amount of damage taken.
5959

60-
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:
60+
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 _Create/Scriptable Events/*_ menu which has the required type:
6161
<p align="center">
6262
<img src="scriptable-event-arg.png"/>
6363
</p>
6464

65-
Next, you'll want to add a listener. Each corresponding _Scriptable Event_ type provides a listener component. Each typed listener works in the same fashion as _Simple Scriptable Event Listener_. The only caveat is when inserting your methods into the _On Raised_ [Unity Event] field. In this case make sure to select a **dynamic** method:
65+
Next, you'll need to add a listener. Each corresponding _Scriptable Event_ type provides a listener component. Each typed listener works in the same fashion as _Simple Scriptable Event Listener_. The only caveat is when inserting your methods into the _On Raised_ [Unity Event] field. In this case make sure to select a **dynamic** method:
6666
<p align="center">
67-
<img hspace="2%" width="45%" src="scriptable-event-listener-components.png"/>
68-
<img hspace="2%" width="45%" src="scriptable-event-listener-dynamic.png"/>
67+
<img hspace="2%" width="40%" src="scriptable-event-listener-components.png"/>
68+
<img hspace="2%" width="40%" src="scriptable-event-listener-dynamic.png"/>
6969
</p>
7070

7171
To trigger the event follow the same steps as with _Simple Scriptable Event_. However, make sure to select a **dynamic** `Raise` method:
@@ -94,9 +94,9 @@ public class TriggerEvent : MonoBehaviour
9494
```
9595

9696
## Creating Custom Events (Custom Events)
97-
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.
97+
In some cases using the built-in argument types is not sufficient. For example, if the player takes damage, you might also need 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.
9898

99-
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:
99+
To start, create a container `class` for your event data. In this example we'll pass the values needed to change the `Metallic` and `Color` properties of a material:
100100
```cs
101101
public class MaterialData
102102
{
@@ -164,7 +164,7 @@ public class MaterialOptionsHandler : MonoBehaviour
164164
}
165165
```
166166

167-
Optionally you can add a custom editor for your event. This will allow you to click the _Raise_ button on your custom event during runtime. To do so, create an editor class which inherits `BaseScriptableEventEditor` in the **Editor** directory:
167+
**Optionally** you can add a custom editor. This will allow you to click the _Raise_ button on your custom event asset during runtime. To do so, create an editor class which inherits `BaseScriptableEventEditor`. Make sure to place this class in the **Editor** directory, or your project will not build:
168168
```cs
169169
using ScriptableEvents.Editor;
170170
using UnityEditor;

0 commit comments

Comments
 (0)