How to implement a ModalWindow like the one available at UnityEditor?
Hi,
I had use the UnityEditor >> EditorUtility.DisplayDialog method to display modal windows that stop the game / function execution up to user press one button on the modal window.
I had use it, for example, to check if there are pending changes to be saved on a map editor when user want to start a new map.
public bool NewMap()
{
// Check if a map has been deployed
if (BoardElements.transform.childCount > 0 || mapPath != "")
{
if (!EditorUtility.DisplayDialog("Discard current process", "There is a current map being editted.\n\nAre you sure that you want to discard it?", "Discard", "Keep Working"))
return false;
}
// Clear current Map
...
}
When I tried to assembly the program, I detected that UnityEditor library is not available outside editor, so I generate a window to show this kind of messages.
My question is, how can I "freeze" this process up to the user click on the window like DisplayDialog done?
I had tried wait methods of Coroutine, but I am unabled to pass the window result to the function that invokes the window.
Thanks
Your answer
Follow this Question
Related Questions
Wait in unity(coroutine not working) 0 Answers
reload script assemblies is VERY Slow. 1 Answer
How to Set Up a Wait Timer, So The Player Can not Do Something Until an Amount Of Time Has Passed 0 Answers
How can I remove 1every second from integer A while bool B is true? 2 Answers
Download remote files on Android while phone is in standby mode 1 Answer