/// <summary> /// Display a prompt utility window. /// </summary> /// <param name="_Title">The window title.</param> /// <param name="_Message">The message to display to the user.</param> /// <param name="_Position">The position of the prompt window.</param> /// <param name="_Size">The size of the prompt window.</param> /// <param name="_OnConfirmCallback">This method will be called once the user clicks on the "Ok" button.</param> /// <param name="_OnCancelCallback">This method will be called once the user clicks on the "Cancel" button or clicks out of the prompt /// window.</param> public static void DisplayPrompt(string _Title, string _Message, Vector2 _Position, Vector2 _Size, OnConfirmDelegate _OnConfirmCallback, OnCancelDelegate _OnCancelCallback = null) { DisplayPrompt(_Title, _Message, new Rect(_Position, _Size), _OnConfirmCallback, _OnCancelCallback); }
/// <summary> /// Display a prompt utility window. /// </summary> /// <param name="_Title">The window title.</param> /// <param name="_OnConfirmCallback">This method will be called once the user clicks on the "Ok" button.</param> /// <param name="_OnCancelCallback">This method will be called once the user clicks on the "Cancel" button or clicks out of the prompt /// window.</param> public static void DisplayPrompt(string _Title, OnConfirmDelegate _OnConfirmCallback, OnCancelDelegate _OnCancelCallback = null) { DisplayPrompt(_Title, string.Empty, _OnConfirmCallback, _OnCancelCallback); }
/// <summary> /// Display a prompt utility window. /// </summary> /// <param name="_Title">The window title.</param> /// <param name="_Message">The message to display to the user.</param> /// <param name="_Position">The position and size of the prompt window.</param> /// <param name="_OnConfirmCallback">This method will be called once the user clicks on the "Ok" button.</param> /// <param name="_OnCancelCallback">This method will be called once the user clicks on the "Cancel" button or clicks out of the prompt /// window.</param> public static void DisplayPrompt(string _Title, string _Message, Rect _Position, OnConfirmDelegate _OnConfirmCallback, OnCancelDelegate _OnCancelCallback = null) { // Close the eventually existing window if (s_OpenedWindow != null) { s_OpenedWindow.Cancel(); } s_OpenedWindow = GetWindow <Prompt>(true, _Title, true); // Set size and position if needed. Rect rect = s_OpenedWindow.position; if (_Position.position != Vector2.zero) { rect.position = _Position.position; } if (_Position.size != Vector2.zero) { rect.size = _Position.size; } s_OpenedWindow.position = rect; // Initialize prompt window s_OpenedWindow.m_Message = _Message; s_OpenedWindow.m_OnConfirmCallback = _OnConfirmCallback; s_OpenedWindow.m_OnCancelCallback = _OnCancelCallback; s_OpenedWindow.Show(); }
/// <summary> /// Display a prompt utility window. /// </summary> /// <param name="_Title">The window title.</param> /// <param name="_Message">The message to display to the user.</param> /// <param name="_OwnerWindow">The window from which the prompt utility is displayed. The prompt will be placed at the same coordinates /// of its owning popup.</param> /// <param name="_Offset">Adds this offset to the owner window's position.</param> /// <param name="_Size">The size of the prompt window.</param> /// <param name="_OnConfirmCallback">This method will be called once the user clicks on the "Ok" button.</param> /// <param name="_OnCancelCallback">This method will be called once the user clicks on the "Cancel" button or clicks out of the prompt /// window.</param> public static void DisplayPrompt(string _Title, string _Message, EditorWindow _OwnerWindow, Vector2 _Offset, Vector2 _Size, OnConfirmDelegate _OnConfirmCallback, OnCancelDelegate _OnCancelCallback = null) { DisplayPrompt(_Title, _Message, new Rect(_OwnerWindow.position.position + _Offset, _Size), _OnConfirmCallback, _OnCancelCallback); }
/// <summary> /// Display a prompt utility window. /// </summary> /// <param name="_Title">The window title.</param> /// <param name="_OwnerWindow">The window from which the prompt utility is displayed. The prompt will be placed at the same coordinates /// of its owning popup.</param> /// <param name="_Offset">Adds this offset to the owner window's position.</param> /// <param name="_Size">The size of the prompt window.</param> /// <param name="_OnConfirmCallback">This method will be called once the user clicks on the "Ok" button.</param> /// <param name="_OnCancelCallback">This method will be called once the user clicks on the "Cancel" button or clicks out of the prompt /// window.</param> public static void DisplayPrompt(string _Title, EditorWindow _OwnerWindow, Vector2 _Offset, Vector2 _Size, OnConfirmDelegate _OnConfirmCallback, OnCancelDelegate _OnCancelCallback = null) { DisplayPrompt(_Title, string.Empty, _OwnerWindow, _Offset, _Size, _OnConfirmCallback, _OnCancelCallback); }
/// <summary> /// Display a prompt utility window. /// </summary> /// <param name="_Title">The window title.</param> /// <param name="_Message">The message to display to the user.</param> /// <param name="_OwnerWindow">The window from which the prompt utility is displayed. The prompt will be placed at the same coordinates /// of its owning popup.</param> /// <param name="_OnConfirmCallback">This method will be called once the user clicks on the "Ok" button.</param> /// <param name="_OnCancelCallback">This method will be called once the user clicks on the "Cancel" button or clicks out of the prompt /// window.</param> public static void DisplayPrompt(string _Title, string _Message, EditorWindow _OwnerWindow, OnConfirmDelegate _OnConfirmCallback, OnCancelDelegate _OnCancelCallback = null) { DisplayPrompt(_Title, _Message, _OwnerWindow, Vector2.zero, Vector2.zero, _OnConfirmCallback, _OnCancelCallback); }