|
|
@@ -105,7 +105,7 @@ Both will inherit from `PropertyWatcherBase`.
|
|
|
|
|
|
We also want to put a full property on the child, let's make it an int and just call it `Counter` with the backing field `_counter`.
|
|
|
|
|
|
-The parent `GameState` class will get its own full property, let's make that one an instead of `ChildGameState` called `Child`, backed by the field `_child`
|
|
|
+The parent `GameState` class will get its own full property, let's make that one a `ChildGameState` called `Child`, backed by the field `_child`
|
|
|
|
|
|
Next, we utilize the `Mutate` method on `Counter`'s `Set` method to hook in the event, and `BindChild` on `Child`'s setter (in GameState) to bubble the event up. We can keep `Child`'s setter `private`, because though we want the properties of our classes to be mutable, we don't want the classes themselves to be.
|
|
|
|
|
|
@@ -200,7 +200,7 @@ Make sure both of these end up in `Assets/Scripts/Entities`, to stay organized.
|
|
|
|
|
|
`TextEntity` needs a serialized `TMP_Text` field, let's call it `Text`, as well as a public method called `SetText` that takes in a string and assigns the value of it to `Text.text`
|
|
|
|
|
|
-`ButtonEntity` needs a public `event` called `Clicked` (untyped of EventHandler), and a method called `OnClick` that null coalesce invokes it (as per typical event style). If you'd like to read up on C# event delegates, [check this link out!](https://learn.microsoft.com/en-us/dotnet/standard/events/)
|
|
|
+`ButtonEntity` needs a public `event` called `Clicked` (of untyped EventHandler), and a method called `OnClick` that null coalesce invokes it (as per typical event style). If you'd like to read up on C# event delegates, [check this link out!](https://learn.microsoft.com/en-us/dotnet/standard/events/)
|
|
|
|
|
|
Your two `MonoBehavior`s should now look like this:
|
|
|
|
|
|
@@ -258,7 +258,7 @@ public class StartupInstaller : MonoInstaller
|
|
|
|
|
|
```
|
|
|
|
|
|
-IMPORTANT! Don't forget to drag and drop the TMP Pro and the Button onto the two new fields we added to `Startup`'s `StartupInstaller` component!
|
|
|
+### IMPORTANT! Don't forget to drag and drop the TMP Pro and the Button onto the two new fields we added to `Startup`'s `StartupInstaller` component!
|
|
|
|
|
|
We are now prepared to wire our Scene up to our `GameEngine`!
|
|
|
|