Oct 19 '09 at 10:56 PM
Nov 20 '09 at 12:41 PM
Here is an example taken from one of my classes.
public class MyBehaviour : MonoBehaviour
public void Update()
// Will run in edit mode.
Oct 19 '09 at 11:42 PM
You simply put:
At the top of your script.
Oct 19 '09 at 10:57 PM
Nice job answering your own question :P
@DaBossTMR: Nice job resurrecting a 3.5 years old question. JFYI: He was last seen on "Jan 2011".
Furthermore his answer isn't correct because attributes always belong to the statement that follows them. It has to be placed right before the class declaration and not at the top of the script. That's how attributes works in general. In UnityScript they just needed a workaround since the class is auto-generated by Unity, so you can't place the "@ExecuteInEditMode" in front of the class. That's why they introduced "@script".
Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.
Once you sign in you will be able to subscribe for any updates here
Answers and Comments
The best place to ask and answer questions about development with Unity. Check out our FAQ for more information.
To help users post good questions and use the site effectively we have posted a tutorial video. Please check it out.
asked: Oct 19 '09 at 10:56 PM
Seen: 4620 times
Last Updated: Mar 11 at 11:21 PM
I need help converting a script to run in the Editor
Does auto-complete for Unity(java)script with any free text editor?
Debug.Log doesn't work properly in a ContextMenu function
How to add new curves or animation events to an imported animation?
Extending Unity IDE with userland code
How do I mimic the Assets->Reimport menu item?
Is there an UML visualisation / class diagram of the Unity API?
What is EditorUtility.CopySerialized supposed to do?
How do I programmatically assign a GameObject to a prefab?
Creating a complex prefab during asset postprocessing