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); } }); }); } }
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); } } }