同步进度
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using System;
|
||||
using Assets.MyGame.Scripts.Net;
|
||||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
@@ -7,12 +8,12 @@ using UnityEngine.UI;
|
||||
public enum GameType
|
||||
{
|
||||
JQQD = 0,
|
||||
defaultPanel = 1,
|
||||
FXZY = 2,
|
||||
TGXX = 3,
|
||||
ZGXQ = 4,
|
||||
XJMH = 5,
|
||||
HHWK = 6,
|
||||
defaultPanel =999,
|
||||
FXZY = 1,
|
||||
TGXX = 2,
|
||||
ZGXQ = 3,
|
||||
XJMH = 4,
|
||||
HHWK = 5,
|
||||
}
|
||||
[Serializable]
|
||||
public class BG_SelectRoom
|
||||
@@ -36,20 +37,25 @@ public class UIHome_BY_SelectRoomLevelPanel : SubUIBase
|
||||
public GameType currGameType;
|
||||
public List<BG_SelectRoom> bG_SelectRooms=new List<BG_SelectRoom>();
|
||||
public Image img_BG;
|
||||
int leave = 1;
|
||||
public override void Awake()
|
||||
{
|
||||
base.Awake();
|
||||
WebSocketManager.Instance.Connect(SocketType.room);
|
||||
MySelectRoom1.onClick.AddListener(() =>
|
||||
{
|
||||
OnSelectRoom(currGameType);
|
||||
leave = 1;
|
||||
});
|
||||
MySelectRoom2.onClick.AddListener(() =>
|
||||
{
|
||||
OnSelectRoom(currGameType);
|
||||
leave = 2;
|
||||
});
|
||||
MySelectRoom3.onClick.AddListener(() =>
|
||||
{
|
||||
OnSelectRoom(currGameType);
|
||||
leave = 3;
|
||||
});
|
||||
SelectRoom1.onClick.AddListener(() =>
|
||||
{
|
||||
@@ -66,13 +72,15 @@ public class UIHome_BY_SelectRoomLevelPanel : SubUIBase
|
||||
}
|
||||
public void OnSelectRoom(object json)
|
||||
{
|
||||
panel_UIHome_BY_MySelectRoomPenel.Show(json);
|
||||
WebSocketManager.Instance.Send(SocketType.room, "{\"type\":1,\"target\":\"GetRoomList\",\"invocationId\":\"1\",\"arguments\":[\""+GameManager.Instance.user.id+"\","+(int)GameManager.Instance.gameData.currGameType+","+leave+",1]}");
|
||||
//这里想websocket发送链接请求
|
||||
//panel_UIHome_BY_MySelectRoomPenel.Show(json);
|
||||
}
|
||||
public void StartGame(object o)
|
||||
{
|
||||
//这里写判断条件
|
||||
GameManager.Instance.StartGame();
|
||||
UIManager.Instance.Close(UIPanel.HomeMainPanel);
|
||||
|
||||
|
||||
}
|
||||
public override void Show(object args = null)
|
||||
@@ -84,9 +92,9 @@ public class UIHome_BY_SelectRoomLevelPanel : SubUIBase
|
||||
GameManager.Instance.gameData.currGameType = currGameType;
|
||||
if (currGameType!= GameType.JQQD)
|
||||
{
|
||||
SelectRoom1.transform.GetChild((int)currGameType).gameObject.SetActive(true);
|
||||
SelectRoom2.transform.GetChild((int)currGameType).gameObject.SetActive(true);
|
||||
SelectRoom3.transform.GetChild((int)currGameType).gameObject.SetActive(true);
|
||||
SelectRoom1.transform.GetChild(((int)currGameType)+1).gameObject.SetActive(true);
|
||||
SelectRoom2.transform.GetChild(((int)currGameType) + 1).gameObject.SetActive(true);
|
||||
SelectRoom3.transform.GetChild(((int)currGameType) + 1).gameObject.SetActive(true);
|
||||
}
|
||||
foreach (var item in bG_SelectRooms)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user