我要在大厅里获得房间的属性。我确定属性会设置为在大厅显示并添加一个字符串。 但是,目前要使用RoomInfo类实例化此属性,它似乎是空的。 这是我用来创建新房间的代码:
RoomName = T.text;
Has.Add("Password", CreateRoomS.Password);
R = new RoomInfo(RoomName,);
if (R.CustomProperties["Password"] == null)
{
PhotonNetwork.JoinRoom(T.text);
}
else
{
Password = (string)R.CustomProperties["Password"];
Protector.GetComponent<Animator>().SetBool("Show", true);
LockPanel.GetComponent<Animator>().SetBool("Show", true);
IsByB = true;
}
这是获取它们的代码:
button_list = []
def create_buttons():
# Create the buttons
for x in range(code_squares):
# Code_squares is how many squares are on the board
new_button = Button(frame_list[x], text = "", relief = RAISED)
new_button.pack(fill=BOTH, expand=1)
new_button.bind("<Button-1>", lambda event: box_open(event, x))
button_list.append(new_button)
def box_open(event, x):
if box_list[x] == "M":
# Checks if the block is a mine
button_list[x].config(text="M", relief = SUNKEN)
# Stops if it was a mine
root.quit()
else:
# If not a mine, it changes the button text to the xth term in box_list, which is the amount of nearby mines.
print("in")
button_list[x].config(text=box_list[x], relief = SUNKEN)