public static void show(string text, Action <string> _onValidated) { if (_onValidated == null) { return; } TextInputDialog window = CreateInstance <TextInputDialog>(); window.text = text; window.onValidated = _onValidated; float width = 200; float height = 60; window.position = new Rect( (Screen.currentResolution.width - width) * 0.5f, (Screen.currentResolution.height - height) * 0.5f, width, height); window.ShowPopup(); window.Focus(); //Rect rect = GUILayoutUtility.GetLastRect(); //window.ShowAsDropDown(rect, new Vector2(200, 60)); //window.Focus(); }
void startRename(FavorityItem item) { editedItem = item; TextInputDialog.show(item.name, onNameChanged); }