x


How do I detect if a scene is being loaded during edit time?

I am using a script which executes during edit mode.(@script ExecuteInEditMode();) and I need to know when my user decides to load a new scene inside the editor. How do I do this?

Cheers

more ▼

asked Jul 12 '12 at 06:12 AM

grimmy gravatar image

grimmy
302 22 34 43

(comments are locked)
10|3000 characters needed characters left

2 answers: sort voted first

Application.isPlaying will be false when code executes in the editor and the game is not running.

more ▼

answered Jul 12 '12 at 06:33 AM

whydoidoit gravatar image

whydoidoit
33k 11 23 99

(comments are locked)
10|3000 characters needed characters left

I'd like to know this too. My best idea right now is to check "EditorApplication.currentScene" in "EditorWindow.Update" to see if it has changed since last time but it's not a very elegant solution...

more ▼

answered Sep 25 '12 at 09:35 AM

ZoltanErdokovy gravatar image

ZoltanErdokovy
20 4

(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:

x716
x297
x62
x29
x2

asked: Jul 12 '12 at 06:12 AM

Seen: 407 times

Last Updated: Sep 25 '12 at 09:35 AM