我创建了我的如何与统一的配对课程。这一切都可以在电脑上正常运行,并且可以轻松创建匹配而没有任何问题。当我尝试为 iOS 创建匹配时,问题就来了。
当我尝试创建一个新匹配时,我在 Xcode 上收到了这个错误:
ArgumentNullException: Argument cannot be null.
Parameter name: baseUri
at System.Uri.Merge (System.Uri baseUri, System.String relativeUri) [0x00000] in <filename unknown>:0
at UnityEngine.Networking.Match.NetworkMatch.ListMatches (UnityEngine.Networking.Match.ListMatchRequest req, UnityEngine.Networking.Match.ResponseDelegate`1 callback) [0x00000] in <filename unknown>:0
(Filename: currently not available on il2cpp Line: -1)
这是用于创建匹配的代码:
void Start()
{
networkMatch = gameObject.AddComponent<NetworkMatch>();
}
private void OnMatchCreate(CreateMatchResponse matchResponse)
{
if (matchResponse.success)
{
NetworkServer.ClearLocalObjects ();
NetworkServer.ClearSpawners ();
NetworkServer.SetAllClientsNotReady ();
Debug.Log("Create match succeeded");
matchCreated = true;
Utility.SetAccessTokenForNetwork(matchResponse.networkId, new NetworkAccessToken(matchResponse.accessTokenString));
NetworkServer.Listen(new MatchInfo(matchResponse), 9000);
UnityEngine.Networking.NetworkManager.singleton.StartServer(new MatchInfo(matchResponse));
}
else
{
Debug.LogError ("Create match failed");
}
}
这里有什么问题?