Commit 33b273d
ConfigSync: call base methods, use if-else chain for IsServer/IsClient
This change is intended to unify the code flow and to reduce diff size
of the upcoming fixes.
Normally, you'd want to call base class methods before your subclass
logic to avoid working with a partially initialized state.
Even though currently ConfigSyncBehaviour inherits directly from
NetworkBehaviour, whose corresponding methods are empty, any of this
might change in the future. So let's make the code more future-proof.
For the reference, these are the values of variables at runtime:
Host:
Awake IsServer=False IsHost=False IsClient=False
Spawn IsServer=True IsHost=True IsClient=True
Despawn IsServer=True IsHost=True IsClient=True
Client (Join):
Awake IsServer=False IsHost=False IsClient=False
Spawn IsServer=False IsHost=False IsClient=True
Despawn IsServer=False IsHost=False IsClient=True1 parent 3ddfcca commit 33b273d
1 file changed
+8
-3
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
53 | 53 | | |
54 | 54 | | |
55 | 55 | | |
| 56 | + | |
| 57 | + | |
56 | 58 | | |
57 | 59 | | |
58 | 60 | | |
| |||
77 | 79 | | |
78 | 80 | | |
79 | 81 | | |
80 | | - | |
81 | 82 | | |
82 | | - | |
83 | | - | |
| 83 | + | |
84 | 84 | | |
85 | 85 | | |
86 | 86 | | |
| |||
96 | 96 | | |
97 | 97 | | |
98 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
99 | 104 | | |
100 | 105 | | |
101 | 106 | | |
| |||
0 commit comments