Fix multiplayer in background
This commit is contained in:
1 file changed
+2
@@ -48,6 +48,7 @@ public class MultiplayerGamePlayer : MonoBehaviour {
|
||||
internal bool IsGrounded() => Physics2D.Distance(bird.GetComponent<CircleCollider2D>(), groundCollider).distance <= 0.1f;
|
||||
|
||||
void Awake() {
|
||||
Application.runInBackground = true;
|
||||
Instance = this;
|
||||
bird = Instantiate(birdTemplate).GetComponent<Image>();
|
||||
Destroy(bird.transform.GetChild(1).gameObject);
|
||||
@@ -454,6 +455,7 @@ public class MultiplayerGamePlayer : MonoBehaviour {
|
||||
public async void Disconnect() {
|
||||
if (disconnecting) return;
|
||||
disconnecting = true;
|
||||
Application.runInBackground = false;
|
||||
Cursor.visible = true;
|
||||
Cursor.lockState = CursorLockMode.None;
|
||||
if (WebsocketHandler.Instance._Connection.State == WebSocketState.Connected) {
|
||||
|
||||
Reference in new issue
Block a user