浏览代码
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
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 次删除
-
55Packages/packages-lock.json
-
38Assets/Scripts/NetworkingManagerHUD.cs
-
11Assets/Scripts/NetworkingManagerHUD.cs.meta
-
7Packages/com.unity.multiplayer.transport.litenet/Runtime/LiteNetLib/LiteNetLib.csproj.meta
|
|||
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); |
|||
} |
|||
} |
|||
|
|
|||
fileFormatVersion: 2 |
|||
guid: e26f82009f8f36d45a99adae79eab7b9 |
|||
MonoImporter: |
|||
externalObjects: {} |
|||
serializedVersion: 2 |
|||
defaultReferences: [] |
|||
executionOrder: 0 |
|||
icon: {instanceID: 0} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
|
|||
fileFormatVersion: 2 |
|||
guid: 11c9a199da28e0144b82a7c9dbd440be |
|||
DefaultImporter: |
|||
externalObjects: {} |
|||
userData: |
|||
assetBundleName: |
|||
assetBundleVariant: |
撰写
预览
正在加载...
取消
保存
Reference in new issue