private void DrawWindow(int id) { BeginVertical(); { BeginHorizontal(); { Label("Key:"); FlexibleSpace(); GUI.SetNextControlName("txtKey"); TextField(KeyText, Width(WindowRect.width / 2)); } EndHorizontal(); Space(2); if (Button("Done")) { LittleAddons.PlayButtonSound(); Close(); } } EndVertical(); if (GUI.GetNameOfFocusedControl() == "txtKey" && Event.current.isKey) { KeyText = Event.current.keyCode.ToString(); Button.Key = Event.current.keyCode; } }
private void DrawWindow(int id) { BeginVertical(); { BeginHorizontal(); { Label("Pulse length: "); string str = TextField(EdgeDetector.PulseLength.ToString(), 3); EdgeDetector.PulseLength = int.Parse(new string(str.Where(Char.IsDigit).ToArray())); } EndHorizontal(); EdgeDetector.PulseLength = (int)HorizontalSlider(EdgeDetector.PulseLength, 1, 20); Label("Pulse on:"); BeginHorizontal(); { EdgeDetector.RisingEdge = Toggle(EdgeDetector.RisingEdge, "Rising edge"); EdgeDetector.FallingEdge = Toggle(EdgeDetector.FallingEdge, "Falling edge"); } EndHorizontal(); Space(2); if (Button("Done")) { LittleAddons.PlayButtonSound(); Close(); } } EndVertical(); }
private void DrawWindow(int id) { BeginVertical(); { BeginHorizontal(); { Label("File path:"); FlexibleSpace(); Buffer = TextField(Buffer, Width(WindowRect.width / 2)); } EndHorizontal(); Reader.BigEndian = Toggle(Reader.BigEndian, "Big endian?"); if (Button("Done")) { LittleAddons.PlayButtonSound(); Reader.FilePath = Buffer; Reader.Reset(true); Visible = false; GameplayUIManager.UIState = UIState.None; } } EndVertical(); }