public override void Awake() { this.requestCode = RequestCode.Room; this.actionCode = ActionCode.JoinRoom; roomListPanel = GetComponent <RoomListPanel>(); base.Awake(); }
private RoomListPanel roomListPanel;//聲明是在哪個UI介面作用 public override void Awake() { requestCode = RequestCode.Room; //要比base.Awake()先執行 actionCode = ActionCode.JoinRoom; //因為base.Awake()內的參數需要 roomListPanel = GetComponent <RoomListPanel>(); //定義UI介面 base.Awake(); }
public override void Awake() { roomListPanel = GetComponent <RoomListPanel>(); requestCode = RequestCode.Room; actionCode = ActionCode.ListRoom; base.Awake(); }
//收到协议 public void OnMsgChoose(MsgBase msgBase) { MsgChoose msg = (MsgChoose)msgBase; if (msg.result == 0) { //提示 PanelManager.Open <TipPanel>("购买成功"); if (PanelManager.panels.ContainsKey("RoomListPanel") && PanelManager.panels["RoomListPanel"] != null) { RoomListPanel panel = (RoomListPanel)PanelManager.panels["RoomListPanel"]; panel.Major = msg.major; panel.Coin = msg.restCoin; } //关闭界面 Close(); } else if (msg.result == 1) { PanelManager.Open <TipPanel>("金币不足,购买失败"); } else { PanelManager.Open <TipPanel>("出现异常"); } }
public override void Start() { requestCode = RequestCode.Room; actionCode = ActionCode.JoinRoom; roomListPanel = GetComponent <RoomListPanel>(); base.Start(); }
public override void Awake() { requestCode = RequestCode.Game; actionCode = ActionCode.UpdateResult; roomListPanel = GetComponent <RoomListPanel>(); base.Awake(); }
public override void Awake() { request = RequestCode.Room; actionCode = ActionCode.CreateRoom; roomListPanel = GetComponent <RoomListPanel>(); base.Awake(); }
/// <summary> /// 设置房间信息 /// </summary> /// <param name="roomId">房间id</param> /// <param name="roomName">房主名</param> /// <param name="totalCount">房主总次数</param> /// <param name="winCount">房主胜利数</param> /// <param name="roomListPanel">roomListPanel的引用</param> public void SetRoomInfo(int roomId, string roomName, int totalCount, int winCount, RoomListPanel roomListPanel) { _roomListPanel = roomListPanel; _roomId = roomId; roomNameText.text = roomName + " 的房间"; totalCountText.text = "总场数" + "\n" + totalCount; winCountText.text = "胜利数" + "\n" + winCount; }
public void SetRoomInfor(int id, string userName, int totalCount, int winCount, RoomListPanel listPanel) { this.id = id; this.roomOwner.text = userName; this.ownerGames.text = "总场次:" + totalCount; this.ownerWinnings.text = "胜场:" + winCount; this.listPanel = listPanel; }
public void SetRoomInfo(int id, string username, string totalCount, string winCount, RoomListPanel roomListPanel) { Id = id; Username.text = username; TotalCount.text = "总场数\n" + totalCount; WinCount.text = "胜场数\n" + winCount; this.roomListPanel = roomListPanel; }
public void SetRoomInfo(int id, string username, string tot, string win, RoomListPanel panel) { this.panel = panel; this.ID = id; this.username.text = username; this.totalCount.text = "Total\n" + tot; this.winCount.text = "Win\n" + win; }
//public void SetRoomInfo(int id, string username, string totalcount, string wincount,RoomListPanel roomlistpanel) //{ // Username.text = userData.UserName; // TotalCount.text = "总场数/n" + userData.TotalCount; // WinCount.text = "胜利/n" + userData.WinCount; // this.panel = roomlistpanel; //} public void SetRoomInfo(UserData userdata, RoomListPanel roomlistpanel) { id = userdata.ID; Username.text = userdata.UserName; TotalCount.text = "总场数" + userdata.TotalCount; WinCount.text = "胜利" + userdata.WinCount; this.panel = roomlistpanel; }
public void SetRoomItemInfo(int id, string username, int totalCount, int winCount, RoomListPanel panel) { this.id = id; this.Username.text = username; this.TotalCount.text = totalCount.ToString(); this.WinCount.text = winCount.ToString(); this.panel = panel; }
/// <summary> /// 设置房间列表中一个条目的房间信息 /// </summary> /// <param name="username"></param> /// <param name="totalCount"></param> /// <param name="winCount"></param> public void SetRoomItemInfo(int id, string username, int totalCount, int winCount, RoomListPanel roomListPanel) { this.id = id; this.roomListPanel = roomListPanel; this.username.text = username; this.totalCount.text = "总场数:" + totalCount; this.winCount.text = "胜场:" + winCount; }
public void SetRoomInfo(int id, string username, string totalCount, string winCount, RoomListPanel panel) { this.id = id; this.username.text = username; this.totalCount.text = "总场数:\n" + totalCount; this.winCount.text = "胜利场数:\n" + winCount; this.panel = panel; }
public void SetRoomInfo(Room room, RoomListPanel panel) { this.id = room.RoomOwner.Id; this.username.text = room.RoomOwner.Username; this.panel = panel; this.room = room; this.clientNum = room.ClientNum; }
//设置显示信息 public void SetRoomInfo(RoomListPanel panel, int id, string username, int totalCount, int winCount) { roomListPanel = panel; Id = id; Username.text = username; TotalCount.text = "总场数\n" + totalCount; WinCount.text = "胜利场数\n" + winCount; }
public void RspReName(GameMsg msg) { audioSvc.PlayAudioInUI(audioSvc.uiAudio); //修改缓存的名字 GameRoot.Instance.SetPlayerName(msg.rspReName.name); //房间列表 roomListPanel = (RoomListPanel)UIManager.Instance.PushPanel(UIPanelType.RoomList); //显示主城UI }
public override void Awake() { //设置JoinRoomRequest的请求码为Room,对应服务器的处理类RommCotroller requestCode = RequestCode.Room; //设置JoinRoomRequest的行为码为JoinRoom,对应RoomCotroller处理类的JoinRoom处理方法 actionCode = ActionCode.JoinRoom; roomListPanel = GetComponent <RoomListPanel>(); base.Awake(); }
public void SetRoomInfo(int id, string username, int totalCount, int winCount, RoomListPanel panel) { this.id = id; this.username.text = username; this.totalCount.text = "总场数\n" + totalCount; this.winCount.text = "胜场\n" + winCount; this.panel = panel; //SetRoomInfo(id, username, totalCount, winCount, panel); }
public override void Awake() { //requestCode = RequestCode.Room; //actionCode = ActionCode.ListRoom; requestType = RequestType.Room; actionType = ActionType.ListRoom; base.Awake(); _roomListPanel = this.GetComponent <RoomListPanel>();//这个和CreatRoomRequest一样,发送请求和接收响应间隔很短 //为保证panel引用能使用,都更早一步进行初始化,放在Awake中 }
public void SetRoomItem(RoomListPanel panel, int id, string name, int total, int win) { roomListPanel = panel; this.id = id; nameText.text = name; totalText.text = "总场次\n" + total.ToString(); winText.text = "胜率\n" + win.ToString(); double percent = Convert.ToDouble(win) / Convert.ToDouble(total); string result = string.Format("{0:0%}", percent); winRateText.text = "胜率\n" + result; }
public void SetRoomItemRes(int id, string userName, int totalCount, int winCount, int mapIndex, RoomListPanel roomListPanel) { this.id = id; this.userName.text = userName; this.roomListPanel = roomListPanel; this.totalCount.text = "总场数\n" + totalCount.ToString(); this.WinCount.text = "胜利\n" + winCount.ToString(); if (mapImage == null) { mapImage = transform.Find("MapImage").GetComponent <Image>(); } mapImage.sprite = new MapInfo(mapIndex, RoleType.None).MapSprite; }
private void Update() { if (_actionState == ActionState.Failed) { MessagePanel msgPanel = GameFacade.Instance.UiManager.PushPanel(PanelType.Message) as MessagePanel; msgPanel.ShowTipsMsg("登陆失败"); _actionState = ActionState.StandBy;//保证只执行一次 } else if (_actionState == ActionState.Success) { // :登录成功后打开房间列表面板- RoomListPanel roomListPanel = GameFacade.Instance.UiManager.PushPanel(PanelType.RoomList) as RoomListPanel; //:显示玩家战绩 roomListPanel.UpdateShowPlayerInfo(GameFacade.Instance.PlayerManager.currentLoginedUser.Id, GameFacade.Instance.PlayerManager.currentLoginedUser.Username, GameFacade.Instance.PlayerManager.currentUserScore.TotalCount, GameFacade.Instance.PlayerManager.currentUserScore.WinCount); _actionState = ActionState.StandBy;//保证只执行一次 } }
void Start() { _roomListPanel = this.GetComponent <RoomListPanel>(); }
public override void Awake() { actionCode = ActionCode.UpdateHistory; roomListPanel = GetComponent <RoomListPanel>(); base.Awake(); }
private void Start() { instance = this; }
public void SetRoomItem(int id, string username, int totalCount, int winCount, RoomListPanel panel) { SetRoomItem(id, username, totalCount.ToString(), winCount.ToString(), panel); }
public override void Awake() { roomListPanel = GetComponent <RoomListPanel>(); this.actionCode = ActionCode.UpdateResult; base.Awake(); }
private void Awake() { base._RequestCode = RequestCode.Room; base._ActionCode = ActionCode.ListRoom; roomListPanel = GetComponent <RoomListPanel>(); }