浏览代码

getting things working after taking develop merge. The MLAPI dependency was unhappy. I've changed the path to something that doesn't 404 for me, and updated the commit hash to the current head of the develop branch (in the mlapi repo)

/main
David Woodruff 4 年前
当前提交
31d04aa4
共有 4 个文件被更改,包括 46 次插入65 次删除
  1. 55
      Packages/packages-lock.json
  2. 38
      Assets/Scripts/NetworkingManagerHUD.cs
  3. 11
      Assets/Scripts/NetworkingManagerHUD.cs.meta
  4. 7
      Packages/com.unity.multiplayer.transport.litenet/Runtime/LiteNetLib/LiteNetLib.csproj.meta

55
Packages/packages-lock.json


{
"dependencies": {
"com.unity.burst": {
"version": "1.3.7",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.mathematics": "1.2.1"
},
"url": "https://packages.unity.com"
},
"com.unity.collab-proxy": {
"version": "1.3.9",
"depth": 0,

},
"com.unity.collections": {
"version": "0.14.0-preview.16",
"depth": 1,
"source": "registry",
"dependencies": {
"com.unity.test-framework.performance": "2.3.1-preview",
"com.unity.burst": "1.3.7"
},
"url": "https://packages.unity.com"
},
"com.unity.ext.nunit": {
"version": "1.0.0",
"depth": 1,

"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.mathematics": {
"version": "1.2.1",
"depth": 3,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"dependencies": {},
"hash": "8e7e3ca556843794618ab91c6b8334b291ff4e3d"
},
"com.unity.multiplayer.transport.litenet": {
"version": "file:com.unity.multiplayer.transport.litenet",
"depth": 0,
"source": "embedded",
"com.unity.multiplayer.mlapi": "0.0.1-preview.1"
}
"com.unity.collections": "0.14.0-preview.16"
},
"hash": "726b77f90f2bb2879303cf72a22048ac0abf4084"
},
"com.unity.multiplayer.transport.litenet": {
"version": "file:com.unity.multiplayer.transport.litenet",

"com.unity.multiplayer.mlapi": "0.0.1-preview.1"
}
},
"com.unity.nuget.newtonsoft-json": {
"version": "2.0.0-preview",
"depth": 3,
"source": "registry",
"dependencies": {},
"url": "https://packages.unity.com"
},
"com.unity.test-framework": {
"version": "1.1.16",
"depth": 0,

"com.unity.modules.imgui": "1.0.0",
"com.unity.modules.jsonserialize": "1.0.0"
},
"url": "https://packages.unity.com"
},
"com.unity.test-framework.performance": {
"version": "2.3.1-preview",
"depth": 2,
"source": "registry",
"dependencies": {
"com.unity.test-framework": "1.1.0",
"com.unity.nuget.newtonsoft-json": "2.0.0-preview"
},
"url": "https://packages.unity.com"
},

38
Assets/Scripts/NetworkingManagerHUD.cs


using UnityEngine;
using MLAPI;
[RequireComponent(typeof(NetworkingManager))]
public class NetworkingManagerHUD : MonoBehaviour
{
void OnGUI()
{
GUILayout.BeginArea(new Rect(10, 10, 300, 300));
if (!NetworkingManager.Singleton.IsClient && !NetworkingManager.Singleton.IsServer)
{
StartButtons();
}
else
{
StatusLabels();
}
GUILayout.EndArea();
}
void StartButtons()
{
if (GUILayout.Button("Host")) NetworkingManager.Singleton.StartHost();
if (GUILayout.Button("Client")) NetworkingManager.Singleton.StartClient();
if (GUILayout.Button("Server")) NetworkingManager.Singleton.StartServer();
}
void StatusLabels()
{
string mode = NetworkingManager.Singleton.IsHost ? "Host" : NetworkingManager.Singleton.IsServer ? "Server" : "Client";
GUILayout.Label("Transport: " + NetworkingManager.Singleton.NetworkConfig.NetworkTransport.GetType().Name);
GUILayout.Label("Mode: " + mode);
}
}

11
Assets/Scripts/NetworkingManagerHUD.cs.meta


fileFormatVersion: 2
guid: e26f82009f8f36d45a99adae79eab7b9
MonoImporter:
externalObjects: {}
serializedVersion: 2
defaultReferences: []
executionOrder: 0
icon: {instanceID: 0}
userData:
assetBundleName:
assetBundleVariant:

7
Packages/com.unity.multiplayer.transport.litenet/Runtime/LiteNetLib/LiteNetLib.csproj.meta


fileFormatVersion: 2
guid: 11c9a199da28e0144b82a7c9dbd440be
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:
正在加载...
取消
保存