Create Dialog Box/pop up windows
have such code
bool b = EditorUtility.DisplayDialog("Test",
"Reset or continue?", "Reset", "Continue");
if (b)
{
ResetGame();
}
but it works only in Editor and not in Game. How to replace the EditorUtility.DisplayDialog with something that works for game?
c# unity3d
add a comment |
have such code
bool b = EditorUtility.DisplayDialog("Test",
"Reset or continue?", "Reset", "Continue");
if (b)
{
ResetGame();
}
but it works only in Editor and not in Game. How to replace the EditorUtility.DisplayDialog with something that works for game?
c# unity3d
add a comment |
have such code
bool b = EditorUtility.DisplayDialog("Test",
"Reset or continue?", "Reset", "Continue");
if (b)
{
ResetGame();
}
but it works only in Editor and not in Game. How to replace the EditorUtility.DisplayDialog with something that works for game?
c# unity3d
have such code
bool b = EditorUtility.DisplayDialog("Test",
"Reset or continue?", "Reset", "Continue");
if (b)
{
ResetGame();
}
but it works only in Editor and not in Game. How to replace the EditorUtility.DisplayDialog with something that works for game?
c# unity3d
c# unity3d
edited Sep 6 '17 at 7:30
Programmer
77.7k1089158
77.7k1089158
asked Apr 22 '16 at 19:01
user3153616user3153616
246
246
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
Any Unity class that includes the word "Editor" or came from the UnityEditor
namespace means that the class
is designed to used in the Editor only and will only work in the Editor. So EditorUtility
is for Unity Editor only.
You need to implement your own Modal Window and to be able to this, you must understand basic Unity UI such as creating buttons, panels, texts. So learn the Unity basic UI first. All you need to do is to put the UI Objects in a panel then acivate/deactivate them when needed.
For example, this is your dialogue panle:
public GameObject dialoguePanel;
to show a dialogue of the UI Panel
dialoguePanel.SetActive(true);
To hide it:
dialoguePanel.SetActive(false);
You can subscribe to the dialogue's button or UI controls events dynamically with onClick.AddListener
. See this post for more information on how to subscribe to UI events.
If you still can't implement your Modal Window, then follow the tutorials below as that's exactly what you are looking for.
Unity Tutorial for a generic modal Window:
MAKING A GENERIC MODAL WINDOW Part 1
MAKING A GENERIC MODAL WINDOW Part 2
MAKING A GENERIC MODAL WINDOW Part 3
how to make your own window ?
– user3153616
Apr 22 '16 at 19:15
@user3153616 You can call it a dialog but it can be called a modal window... It becomes a Modal window when you have a dialog with background picture and can be moved around if you want it to. The tutorials 1 to 3 will show you how.
– Programmer
Apr 22 '16 at 19:23
add a comment |
Your Answer
StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");
StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});
function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});
}
});
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f36801470%2fcreate-dialog-box-pop-up-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
Any Unity class that includes the word "Editor" or came from the UnityEditor
namespace means that the class
is designed to used in the Editor only and will only work in the Editor. So EditorUtility
is for Unity Editor only.
You need to implement your own Modal Window and to be able to this, you must understand basic Unity UI such as creating buttons, panels, texts. So learn the Unity basic UI first. All you need to do is to put the UI Objects in a panel then acivate/deactivate them when needed.
For example, this is your dialogue panle:
public GameObject dialoguePanel;
to show a dialogue of the UI Panel
dialoguePanel.SetActive(true);
To hide it:
dialoguePanel.SetActive(false);
You can subscribe to the dialogue's button or UI controls events dynamically with onClick.AddListener
. See this post for more information on how to subscribe to UI events.
If you still can't implement your Modal Window, then follow the tutorials below as that's exactly what you are looking for.
Unity Tutorial for a generic modal Window:
MAKING A GENERIC MODAL WINDOW Part 1
MAKING A GENERIC MODAL WINDOW Part 2
MAKING A GENERIC MODAL WINDOW Part 3
how to make your own window ?
– user3153616
Apr 22 '16 at 19:15
@user3153616 You can call it a dialog but it can be called a modal window... It becomes a Modal window when you have a dialog with background picture and can be moved around if you want it to. The tutorials 1 to 3 will show you how.
– Programmer
Apr 22 '16 at 19:23
add a comment |
Any Unity class that includes the word "Editor" or came from the UnityEditor
namespace means that the class
is designed to used in the Editor only and will only work in the Editor. So EditorUtility
is for Unity Editor only.
You need to implement your own Modal Window and to be able to this, you must understand basic Unity UI such as creating buttons, panels, texts. So learn the Unity basic UI first. All you need to do is to put the UI Objects in a panel then acivate/deactivate them when needed.
For example, this is your dialogue panle:
public GameObject dialoguePanel;
to show a dialogue of the UI Panel
dialoguePanel.SetActive(true);
To hide it:
dialoguePanel.SetActive(false);
You can subscribe to the dialogue's button or UI controls events dynamically with onClick.AddListener
. See this post for more information on how to subscribe to UI events.
If you still can't implement your Modal Window, then follow the tutorials below as that's exactly what you are looking for.
Unity Tutorial for a generic modal Window:
MAKING A GENERIC MODAL WINDOW Part 1
MAKING A GENERIC MODAL WINDOW Part 2
MAKING A GENERIC MODAL WINDOW Part 3
how to make your own window ?
– user3153616
Apr 22 '16 at 19:15
@user3153616 You can call it a dialog but it can be called a modal window... It becomes a Modal window when you have a dialog with background picture and can be moved around if you want it to. The tutorials 1 to 3 will show you how.
– Programmer
Apr 22 '16 at 19:23
add a comment |
Any Unity class that includes the word "Editor" or came from the UnityEditor
namespace means that the class
is designed to used in the Editor only and will only work in the Editor. So EditorUtility
is for Unity Editor only.
You need to implement your own Modal Window and to be able to this, you must understand basic Unity UI such as creating buttons, panels, texts. So learn the Unity basic UI first. All you need to do is to put the UI Objects in a panel then acivate/deactivate them when needed.
For example, this is your dialogue panle:
public GameObject dialoguePanel;
to show a dialogue of the UI Panel
dialoguePanel.SetActive(true);
To hide it:
dialoguePanel.SetActive(false);
You can subscribe to the dialogue's button or UI controls events dynamically with onClick.AddListener
. See this post for more information on how to subscribe to UI events.
If you still can't implement your Modal Window, then follow the tutorials below as that's exactly what you are looking for.
Unity Tutorial for a generic modal Window:
MAKING A GENERIC MODAL WINDOW Part 1
MAKING A GENERIC MODAL WINDOW Part 2
MAKING A GENERIC MODAL WINDOW Part 3
Any Unity class that includes the word "Editor" or came from the UnityEditor
namespace means that the class
is designed to used in the Editor only and will only work in the Editor. So EditorUtility
is for Unity Editor only.
You need to implement your own Modal Window and to be able to this, you must understand basic Unity UI such as creating buttons, panels, texts. So learn the Unity basic UI first. All you need to do is to put the UI Objects in a panel then acivate/deactivate them when needed.
For example, this is your dialogue panle:
public GameObject dialoguePanel;
to show a dialogue of the UI Panel
dialoguePanel.SetActive(true);
To hide it:
dialoguePanel.SetActive(false);
You can subscribe to the dialogue's button or UI controls events dynamically with onClick.AddListener
. See this post for more information on how to subscribe to UI events.
If you still can't implement your Modal Window, then follow the tutorials below as that's exactly what you are looking for.
Unity Tutorial for a generic modal Window:
MAKING A GENERIC MODAL WINDOW Part 1
MAKING A GENERIC MODAL WINDOW Part 2
MAKING A GENERIC MODAL WINDOW Part 3
edited Sep 6 '17 at 7:38
answered Apr 22 '16 at 19:12
ProgrammerProgrammer
77.7k1089158
77.7k1089158
how to make your own window ?
– user3153616
Apr 22 '16 at 19:15
@user3153616 You can call it a dialog but it can be called a modal window... It becomes a Modal window when you have a dialog with background picture and can be moved around if you want it to. The tutorials 1 to 3 will show you how.
– Programmer
Apr 22 '16 at 19:23
add a comment |
how to make your own window ?
– user3153616
Apr 22 '16 at 19:15
@user3153616 You can call it a dialog but it can be called a modal window... It becomes a Modal window when you have a dialog with background picture and can be moved around if you want it to. The tutorials 1 to 3 will show you how.
– Programmer
Apr 22 '16 at 19:23
how to make your own window ?
– user3153616
Apr 22 '16 at 19:15
how to make your own window ?
– user3153616
Apr 22 '16 at 19:15
@user3153616 You can call it a dialog but it can be called a modal window... It becomes a Modal window when you have a dialog with background picture and can be moved around if you want it to. The tutorials 1 to 3 will show you how.
– Programmer
Apr 22 '16 at 19:23
@user3153616 You can call it a dialog but it can be called a modal window... It becomes a Modal window when you have a dialog with background picture and can be moved around if you want it to. The tutorials 1 to 3 will show you how.
– Programmer
Apr 22 '16 at 19:23
add a comment |
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f36801470%2fcreate-dialog-box-pop-up-windows%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown