12345678910111213141516171819202122 |
- // The PrintAwake script is placed on a GameObject. The Awake function is
- // called when the GameObject is started at runtime. The script is also
- // called by the Editor. An example is when the Scene is changed to a
- // different Scene in the Project window.
- // The Update() function is called, for example, when the GameObject transform
- // position is changed in the Editor.
- using UnityEngine;
- [ExecuteInEditMode]
- public class PrintAwake : MonoBehaviour
- {
- void Awake()
- {
- Debug.Log("Editor causes this Awake");
- }
- void Update()
- {
- Debug.Log("Editor causes this Update");
- }
- }
|