This commit is contained in:
parent
861ecd1ba9
commit
bcded4bbfb
|
|
@ -42,13 +42,11 @@ public class Taskpanel : MonoBehaviour
|
||||||
private bool isp = true;
|
private bool isp = true;
|
||||||
void Start()
|
void Start()
|
||||||
{
|
{
|
||||||
SyncCreateRoom.send2roomRequset += OnOtherPlayerOnline;
|
|
||||||
fanhui.onClick.AddListener(() =>
|
fanhui.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
GameMain.tiao = false;
|
GameMain.tiao = false;
|
||||||
OnLeaveRoom();
|
OnLeaveRoom();
|
||||||
|
|
||||||
|
|
||||||
});
|
});
|
||||||
two_dimensional.onClick.AddListener(() =>
|
two_dimensional.onClick.AddListener(() =>
|
||||||
{
|
{
|
||||||
|
|
@ -144,25 +142,11 @@ public class Taskpanel : MonoBehaviour
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void OnOtherPlayerOnline(string msg)
|
|
||||||
{
|
|
||||||
string[] data = msg.Split(',');
|
|
||||||
Debug.Log(data[1]);
|
|
||||||
if (data[0] == "offline")
|
|
||||||
{
|
|
||||||
GameManager.Instance.RemovePlayer(ulong.Parse(data[1]));
|
|
||||||
string _msg = "leaveroom ";
|
|
||||||
_ = SyncCreateRoom.SendMessageAsync(_msg);
|
|
||||||
}
|
|
||||||
if (GameManager.Instance.isPlayer)
|
|
||||||
SceneManager.LoadScene("SampleScene");
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
public void OnLeaveRoom()
|
public void OnLeaveRoom()
|
||||||
{
|
{
|
||||||
Debug.Log("Leaveroom");
|
Debug.Log("Leaveroom");
|
||||||
_ = SyncCreateRoom.SendMessageAsync($"send2room offline,{GlobalFlag.currentUser.user_id}");
|
_ = SyncCreateRoom.SendMessageAsync($"send2room offline,{GlobalFlag.currentUser.user_id}");
|
||||||
|
SceneManager.LoadScene("SampleScene");
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue