Page 1 of 1

Editor Note Destroy Question

Posted: Thu May 16, 2019 8:17 pm
by nathanj
Hi Tony,

I just noticed that the Editor Note component destroys itself when in build. Is this necessary?

I really like the component and would like to use it to mark up more game objects but if it destroys those objects in build its not usable for me. It's easy enough to edit the script and comment out "Destroy(this)" on my end but I'm wondering why it's written as is?

Thanks as always
Nathan

Re: Editor Note Destroy Question

Posted: Thu May 16, 2019 8:53 pm
by Tony Li
Hi Nathan,

What's your use-case for Editor Note? The original idea was that it would just provide a note in the editor when you're inspecting GameObjects, but it wouldn't take up any space in builds. Do you want to be able to access the note's content at runtime in a build?

Re: Editor Note Destroy Question

Posted: Thu May 16, 2019 8:55 pm
by nathanj
I had thrown it on some management components to explain things to my future self and colleagues. I could just have a note component thrown on an empty game object, that totally works.

Does it destory the component or the gameobject?

I just noticed that the error i was having was due to my own set up and not the editor script, so this whole thread could, once again, be a simple result of user misunderstanding ;)

Re: Editor Note Destroy Question

Posted: Thu May 16, 2019 9:05 pm
by Tony Li
It only destroys the Editor Note component. It leaves the rest of the GameObject untouched.

Re: Editor Note Destroy Question

Posted: Thu May 16, 2019 9:06 pm
by nathanj
Ya, ok. sorry for wasiting your time.

Thanks again though

Nathan

Re: Editor Note Destroy Question

Posted: Thu May 16, 2019 9:08 pm
by Tony Li
It was certainly wise of you to check. That would be a pretty bad thing if it destroyed entire GameObjects.