x


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?

more ▼

asked Nov 03 '11 at 02:40 AM

noob22 gravatar image

noob22
48 42 47 49

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)

Nov 03 '11 at 02:58 AM syclamoth
(comments are locked)
10|3000 characters needed characters left

1 answer: sort voted first

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)"

more ▼

answered Nov 03 '11 at 06:54 AM

DaveA gravatar image

DaveA
26.5k 151 171 256

What are you doing here? Just convert my comment into an answer, if it's that important to you.

Nov 03 '11 at 07:19 AM syclamoth

So we can't use it in our games!?And what could it do? What is it exist reason?

Nov 03 '11 at 08:35 AM noob22

It's for extending the editor, for in-game uses search for "Unity GUI" and you'll find plenty of results.

Nov 03 '11 at 08:38 AM gfr

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.

Nov 03 '11 at 08:43 AM syclamoth

Right, worst case, just code your own GUI window to do it.

Nov 03 '11 at 08:49 AM DaveA
(comments are locked)
10|3000 characters needed characters left
Your answer
toggle preview:

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Topics:

x3342
x2097
x375
x55
x32

asked: Nov 03 '11 at 02:40 AM

Seen: 1076 times

Last Updated: Nov 03 '11 at 08:49 AM