Commit a1d4131
Fix FollowMeToggle's auto-follow breaking if the component is disabled (#10620)
* Fix FollowMeToggle's auto-follow breaking if the component is ever disabled
`FollowMeToggle` has an `AutoFollowAtDistance` feature which breaks if the `FollowMeToggle` component is ever disabled and re-enabled. This is because the `AutoFollowAtDistance` property setter checks if the `autoFollowDistanceCheck` coroutine is null before starting the coroutine. If the component is disabled, the coroutine will _stop_ but not become null. When the component is re-enabled, the coroutine does not start again because the previous instance is non-null, even though it is no longer running.
This is fixed by simply setting `autoFollowDistanceCheck` to null in `OnDisable()`.
* FollowMeToggle: formatting tweak
Per keveleigh
Co-authored-by: Kurtis <[email protected]>
Co-authored-by: Kurtis <[email protected]>1 parent a223741 commit a1d4131
1 file changed
+5
-0
lines changedLines changed: 5 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
183 | 183 | | |
184 | 184 | | |
185 | 185 | | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
186 | 191 | | |
187 | 192 | | |
188 | 193 | | |
| |||
0 commit comments