我正在跟随一个教程视频,为玩家设置一个大厅来主持和加入游戏,我一直得到这些错误:
error CS0115: 'NetworkManagerLobby.OnServerConnect(NetworkConnection)': no suitable method found to override
error CS0115: 'NetworkManagerLobby.OnServerAddPlayer(NetworkConnection)': no suitable method found to override
public override void OnServerAddPlayer(NetworkConnection conn)
public override void OnServerConnect(NetworkConnection conn)
我已经包含了using Mirror
,类继承自Network Manager。
Unity版本2021.3.5f1
我将非常感谢任何帮助!
你确定你的参数类型是正确的吗?我想它应该是"NetworkConnectionToClient">
public virtual void OnServerAddPlayer(NetworkConnectionToClient conn)
public virtual void OnServerConnect(NetworkConnectionToClient conn) {}