Exemple #1
0
    private void EditRoom()
    {
        roomId = GetComponentInParent <RootJoinRoomView>().GetComponentInChildren <ListView>().selectRoomId;
        RestFulProxy.IsEditRoom(int.Parse
                                    (roomId), (result) => {
            if (result.Equals("0"))
            {
                transform.localScale = Vector3.one;
                ShowHideList(false);
                Room room = ListData.FindRoomByKey(roomId);
                if (room != null)
                {
                    roomName.text                = room.name.Trim();
                    gamePasswordInput.text       = "";
                    roomCreatePasswordInput.text = room.checkCode.Trim();
                }

                SetGrounpName();
                SetTitle("编辑战队");
            }
            else
            {
                GetComponentInParent <RootJoinRoomView>().errorMessage.ShowMessage("非法操作", SoundType.Error);
            }
        });
    }
Exemple #2
0
 public void DeleteRoom(UnityAction <string> action)
 {
     DeleteButton.onClick.AddListener(() => {
         //检查是否有权限
         string roomId = GetComponentInParent <RootJoinRoomView>().GetComponentInChildren <ListView>().selectRoomId;
         RestFulProxy.IsEditRoom(int.Parse(roomId), (result) => {
             if (result.Equals("0"))
             {
                 action.Invoke(roomId);
             }
             else
             {
                 GetComponentInParent <RootJoinRoomView>().errorMessage.ShowMessage("非法操作", SoundType.Error);
             }
         });
     });
 }