public virtual void DebugMenu() { enabled = GUILayout.Toggle(enabled, "LatencyChckerLine"); if (enabled) { GUIUtil.Indent(() => { _width = GUIUtil.Slider(_width, 0f, 20f, "width"); using (var h = new GUILayout.HorizontalScope()) { _timeEnable = GUILayout.Toggle(_timeEnable, "Time"); _timeStride = GUIUtil.Slider(_timeStride, 0.1f, 10f, "Stride"); } using (var h = new GUILayout.HorizontalScope()) { _networkTimeEnable = GUILayout.Toggle(_networkTimeEnable, "NetworkTime"); _networkTimeStride = GUIUtil.Slider(_networkTimeStride, 0.1f, 10f, "Stride"); } DebugMenuInternal(); _datas.ForEach(data => { using (var h = new GUILayout.HorizontalScope()) { data.enable = GUILayout.Toggle(data.enable, data.name); data.mode = GUIUtil.Field(data.mode); } }); }); } }
protected override void OnGUINetworkSetting() { _sceneSelector.DebugMenu(); networkAddress = GUIUtil.Field(networkAddress, "Host Address"); networkPort = GUIUtil.Field(networkPort, "Host Port"); DebugMenuInternal(); }
public void DebugMenu() { GUILayout.Label("SyncParamExample"); GUIUtil.Indent(() => { _bool = GUIUtil.Field(_bool, "bool"); _int = GUIUtil.Field(_int, "int"); _uint = GUIUtil.Field(_uint, "uint"); _float = GUIUtil.Field(_float, "float"); _string = GUIUtil.Field(_string, "string"); _vector2 = GUIUtil.Field(_vector2, "vector2"); _vector3 = GUIUtil.Field(_vector3, "vector3"); _vector4 = GUIUtil.Field(_vector4, "vector4"); }); }
public virtual void OnGUI() { if (_networkManager != null && !_networkManager.isNetworkActive) { GUILayout.Label("SyncUtil Manual Boot"); var mgr = _networkManager; OnGUINetworkSetting(); mgr.useSimulator = GUILayout.Toggle(mgr.useSimulator, "Use Network Simulator"); if (mgr.useSimulator) { mgr.simulatedLatency = GUIUtil.Slider(mgr.simulatedLatency, 1, 400, "Latency[msec]"); mgr.packetLossPercentage = GUIUtil.Slider(mgr.packetLossPercentage, 0f, 20f, "PacketLoss[%]"); } GUILayout.Space(16f); GUILayout.Label("Boot Type (Manual. once only):"); if (GUILayout.Button("Host (client & server)")) { OnNetworkStartByManual(); StartNetwork(BootType.Host); } if (GUILayout.Button("Client")) { OnNetworkStartByManual(); StartNetwork(BootType.Client); } if (GUILayout.Button("Server")) { OnNetworkStartByManual(); StartNetwork(BootType.Server); } } }
public void DebugMenu() { using (var h = new GUILayout.HorizontalScope()) { GUILayout.Label("NetworkManagerController"); GUILayout.Label(SyncNet.isHost ? "Host" : (SyncNet.isServer ? "Server" : (SyncNet.isClient ? "Client" : "StandAlone"))); if (SyncNet.isActive) { if (GUILayout.Button("Disconnect")) { NetworkManager.Shutdown(); } } } GUIUtil.Indent(() => { DebugMenuInternal(); if (_fold == null) { _fold = new GUIUtil.Fold("Time Debug", () => { GUILayout.Label(string.Format("SyncTime: {0:0.000}", SyncNet.time)); //GUILayout.Label(string.Format("Network.time Synced/Orig: {0:0.000} / {1:0.000}", SyncNet.networkTime, Network.time)); LatencyChecker.Instance._conectionLatencyTable.ToList().ForEach(pair => { var data = pair.Value; GUILayout.Label(string.Format("ConnId: {0} Latency: {1:0.000} Average:{2:0.000} " + (data._recieved ? "✔" : ""), pair.Key, data.Last, data.average)); }); }); } _fold.OnGUI(); }); }
protected override void DebugMenuInternal() { autoConnect = GUIUtil.Field(autoConnect, "AutoConnect"); autoConnectInterval = GUIUtil.Field(autoConnectInterval, "AutoConnectInterval"); }