Version: 2019.1

InitializeOnLoadAttribute

class in UnityEditor

マニュアルに切り替える

説明

エディタークラスを Unity 起動時に初期化します。(ユーザーのアクションは不要)

Note that static constructors with this attribute are called when Unity starts and when Run is pressed. In this second case the Unity runtime is intialised and this is treated as a Load.
See the manual page about running editor code on launch for further details.