Skip to content
This repository was archived by the owner on Aug 10, 2021. It is now read-only.

Commit 8dca888

Browse files
committed
Simplify documentation
1 parent 7948610 commit 8dca888

File tree

1 file changed

+6
-8
lines changed

1 file changed

+6
-8
lines changed

Documentation/README.md

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,12 +3,10 @@
33
## Game Events
44
The library provides two types of game events:
55
- `GameEvent` without arguments.
6-
- `ArgumentGameEvent` which accept arguments.
6+
- `ArgumentGameEvent` which accepts arguments.
77

88
### Game event assets
9-
The core of events is game event `ScriptableObject` assets. They store game event listeners and notify them when an event is raised.
10-
11-
To use game events, create an appropriate game event type asset (where _"Argument Name"_ is type of the argument that you are going to be passing to your events):
9+
The core of events is game event `ScriptableObject` assets. They store game event listeners and notify them when an event is raised. To use game events, create an appropriate game event type asset (where _"Argument Name"_ is type of the argument that you are going to be passing to your events):
1210
- `GameEvent` - _Right Click -> Create -> Game Events -> Game Event_
1311
- `ArgumentGameEvent` - _Right Click -> Create -> Game Events -> "Argument Name" Game Event_
1412

@@ -45,7 +43,7 @@ public class CustomGameEvent : ArgumentGameEvent<Custom>
4543
}
4644
```
4745

48-
In order to enable raising of custom game events from the inspector, create a `CustomEditor` script where the argument fields are going to be drawn. To do so, define an editor script, extend `GameEvents.Generic.ArgumentGameEventEditor` and override `DrawArgumentField(Custom)` . Make sure to place this script under the `Editor` folder:
46+
In order to enable raising of custom game events from the inspector, create a `CustomEditor` script where the argument fields are going to be drawn. Extend `GameEvents.Generic.ArgumentGameEventEditor` and override `DrawArgumentField(Custom)`. Make sure to place this script under the `Editor` folder:
4947
```cs
5048
[CustomEditor(typeof(CustomGameEvent))]
5149
public class CustomGameEventEditor : ArgumentGameEventEditor<CustomGameEvent, Custom>
@@ -58,22 +56,22 @@ public class CustomGameEventEditor : ArgumentGameEventEditor<CustomGameEvent, Cu
5856
```
5957

6058
### Game event listeners
61-
Game events can be listened to by listener components. To use listeners, you need to create an appropriate listener component:
59+
Game events can be listened to by listener components. To use pre-made listeners, add an appropriate listener component:
6260
- `GameEvent` - _Add Component -> Game Events -> Game Event Listener_
6361
- `ArgumentGameEvent` - _Add Component -> Game Events -> "Argument Name" Game Event Listener_
6462

6563
Once the component is added, slot in the appropriate `GameEvent` you want the listener to listen to and add your response methods to `onGameEvent` callback via the inspector.
6664

6765
### Custom game event listeners
68-
Custom game event listeners which accept different arguments can also be created. First of all, create a `UnityEvent` which would accept your `Custom` type:
66+
Custom game event listeners which accept different arguments can also be created. Create a `UnityEvent` which would accept your `Custom` type:
6967
```cs
7068
[Serializable]
7169
public class CustomEvent : UnityEvent<Custom>
7270
{
7371
}
7472
```
7573

76-
Then, create a custom game event listener which. This can be done by extending `GameEvents.Generic.ArgumentGameEventListener` class.
74+
Then, create a custom game event listener by extending `GameEvents.Generic.ArgumentGameEventListener`.
7775
```cs
7876
[AddComponentMenu("Game Events/Custom Game Event Listener")]
7977
public class CustomGameEventListener : ArgumentGameEventListener<CustomGameEvent, CustomEvent, Custom>

0 commit comments

Comments
 (0)