示例#1
0
 // Reduce the visibility of OnEnable;
 private void OnEnable()
 {
 #if UNITY_EDITOR
     if (!EditorApplication.isPlayingOrWillChangePlaymode)
     {
         return;
     }
 #endif
     AllSingletons.Add(this);
 }
示例#2
0
        // Reduce the visibility of OnEnable; Inheritors should override Initialize instead.
        private new void OnEnable()
        {
            base.OnEnable();
#if UNITY_EDITOR
            if (!UnityEditor.EditorApplication.isPlayingOrWillChangePlaymode)
            {
                return;
            }
#endif
            AllSingletons.Add(this);
        }