This commit is contained in:
YangHua 2023-11-22 16:33:04 +08:00
parent 20ef229f32
commit 1820f61d6f
2 changed files with 3 additions and 4 deletions

View File

@ -148,12 +148,11 @@ public class Taskpanel : MonoBehaviour
{
string[] data = msg.Split(',');
Debug.Log(data[1]);
if(data[0] == "offline")
if (data[0] == "offline")
{
GameManager.Instance.RemovePlayer(ulong.Parse(data[1]));
string _msg = "leaveroom ";
_ = SyncCreateRoom.SendMessageAsync(_msg);
SceneManager.LoadScene("SampleScene");
}
}
@ -162,6 +161,7 @@ public class Taskpanel : MonoBehaviour
{
Debug.Log("Leaveroom");
_ = SyncCreateRoom.SendMessageAsync($"send2room offline,{GlobalFlag.currentUser.user_id}");
SceneManager.LoadScene("SampleScene");
}
}

View File

@ -136,7 +136,6 @@ public class GameManager : MonoSingleton<GameManager>
{
if (players[i].userID == playerID)
{
players.Remove(players[i]);
Destroy(players[i].gameObject);
}
}