- Home /
Question by
NutellaDaddy · Jun 14, 2014 at 03:29 AM ·
editorstartup
Is there a function like Start for starting up unity?
Is there a function like Start that does whatever is in it when you start up unity?
Comment
Best Answer
Answer by iwaldrop · Jun 14, 2014 at 03:37 AM
You can call a static constructor from an editor script:
unity UnityEditor;
[InitializeOnLoad]
public class ExampleClassName
{
static ExampleClassName()
{
// do something when the application starts
}
}
This would also be called after script compilation finishes, so be aware of that.
Your answer
![](https://koobas.hobune.stream/wayback/20220613151504im_/https://answers.unity.com/themes/thub/images/avi.jpg)
Follow this Question
Related Questions
Running a script when Unity starts. 3 Answers
The name 'Joystick' does not denote a valid type ('not found') 2 Answers
Need help with editor (script?) 1 Answer
How can I preserve static object/data between editor and play? 2 Answers
Cloning GameObjects with custom inspector script attached 0 Answers