ExecuteInEditMode

ExecuteInEditMode

  当我们为MonoBehavior定义了[ExecuteInEditMode]后,我们需要关心Awake和Start在编辑器中的执行状况。


  1、当该MonoBehavior在编辑器中被赋于给GameObject的时候,Awake, Start 将被执行。
  2、当Play按钮被按下游戏开始以后,Awake, Start 将被执行。
  3、当Play按钮停止后,Awake, Start将再次被执行。
  4、当在编辑器中打开包含有该MonoBehavior的场景的时候,Awake, Start将被执行。

参考:http://www.cnblogs.com/xpvincent/p/3178042.html

原文地址:https://www.cnblogs.com/tekkaman/p/3834479.html