- Home /
How to use unityeditor and where I need it?
I want to make a dialog which ask user be sure to esc when user press esc!I show document say EditorUtility.DisplayDialog can do this!But It 's unityeditor class,I don't know how to use it! Document say "To use it you have to place your script in Assets/Editor inside your project folder" and I cound't put it in Gameobject like runtime api.Now how to use it?
Well, by definition you can't do this. Sorry! UnityEditor is talking about classes which can only be used in the Editor (i.e, for development). Any classes which use the UnityEditor functions will not even be included in your builds, so there's no way of using them in an actual game.
(unless you do something silly like make a distraction for unity developers which runs entirely in the Editor. That would be incredibly silly, but there's no reason why you can't do it)
Answer by DaveA · Nov 03, 2011 at 06:54 AM
An answer is "Well, by definition you can't do this. Sorry! UnityEditor is talking about classes which can only be used in the Editor (i.e, for development). Any classes which use the UnityEditor functions will not even be included in your builds, so there's no way of using them in an actual game.
(unless you do something silly like make a distraction for unity developers which runs entirely in the Editor. That would be incredibly silly, but there's no reason why you can't do it)"
What are you doing here? Just convert my comment into an answer, if it's that important to you.
So we can't use it in our games!?And what could it do? What is it exist reason?
It's for extending the editor, for in-game uses search for "Unity GUI" and you'll find plenty of results.
I think @noob22 is trying to get an OS-native external message window to appear. Unfortunately, outside of the Editor, Unity does not provide any easy way of doing this.
Your answer
Follow this Question
Related Questions
Assign gameObject to a variable at runtime 2 Answers
how can I display a variable as a GUIText 5 Answers
Game freezes everything when calling WaitForSeconds 1 Answer
Why do Instantiated GameObjects Colliders only work on player i am controlling,nothing else? 2 Answers
Destroy all GameObjects EXCEPT some... 2 Answers