Im im very new to unity, and started off with some tutorials. Also i do a simple test project to get to understand the basic stuff.
Now what i try to do, is make a messagebox pop up when the ESC key is pressed.
if it would have been a win application, i would have done something like this in C#:
if (Input.GetKeyDown(KeyCode.Escape))
{
var message = "exitmessage";
var title = "exitTitle";
var result = MessageBox.Show(
message, // the message to show
title, // the title for the dialog box
MessageBoxButton.YesNo, // show two buttons: Yes and No
MessageBoxImage.Question); // show a question mark icon
// lets see what has been pressed
switch (result)
{
case System.Windows.MessageBoxResult.Yes: // Yes button pressed
Application.Quit();
break;
case System.Windows.MessageBoxResult.No: // No button pressed
break;
default: // Neither Yes nor No pressed (just in case)
MessageBox.Show("Oh noes! What did you press?!?!");
break;
}
}
But it is no Win app, it is Unity.
Now, i dont have a clue how i should make something like this in unity.
Could someone point me in the right direction with a sample, or a website or something that would help me?
thank you in advance.