PrintAwake.cs 620 B

12345678910111213141516171819202122
  1. // The PrintAwake script is placed on a GameObject. The Awake function is
  2. // called when the GameObject is started at runtime. The script is also
  3. // called by the Editor. An example is when the Scene is changed to a
  4. // different Scene in the Project window.
  5. // The Update() function is called, for example, when the GameObject transform
  6. // position is changed in the Editor.
  7. using UnityEngine;
  8. [ExecuteInEditMode]
  9. public class PrintAwake : MonoBehaviour
  10. {
  11. void Awake()
  12. {
  13. Debug.Log("Editor causes this Awake");
  14. }
  15. void Update()
  16. {
  17. Debug.Log("Editor causes this Update");
  18. }
  19. }