Performance Boost
MinigamesClient.currentInstance.Close(); Correctly Ends all streams from the mini game
This commit is contained in:
@@ -89,6 +89,7 @@ public class Client : MonoBehaviour
|
||||
g.SetActive(true);
|
||||
}
|
||||
|
||||
MinigamesClient.currentInstance.Close();
|
||||
SceneManager.UnloadSceneAsync(miniGamesMapping[currentMiniGameId]);
|
||||
}
|
||||
|
||||
@@ -423,7 +424,6 @@ public class Client : MonoBehaviour
|
||||
break;
|
||||
|
||||
case 101:
|
||||
Debug.Log("test");
|
||||
UnloadMinigame();
|
||||
break;
|
||||
case 126:
|
||||
|
||||
@@ -13,9 +13,13 @@ public class MinigamesClient : MonoBehaviour
|
||||
private Stream stream;
|
||||
|
||||
private Queue<Job> jobs = new Queue<Job>();
|
||||
|
||||
public static MinigamesClient currentInstance;
|
||||
|
||||
private void Start()
|
||||
{
|
||||
currentInstance = this;
|
||||
|
||||
client = new TcpClient("185.245.96.48", 8051);
|
||||
stream = client.GetStream();
|
||||
|
||||
@@ -55,4 +59,10 @@ public class MinigamesClient : MonoBehaviour
|
||||
jobs.Enqueue(new Job(read));
|
||||
}
|
||||
}
|
||||
|
||||
public void Close()
|
||||
{
|
||||
stream.Close();
|
||||
client.Close();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user