Example #1
0
 private static void ensureInstanceExists()
 {
     if (_devInstance == null)
     {
         _devInstance = FindObjectOfType <Dev>();
         if (_devInstance == null)
         {
             _devInstance = new GameObject("__Dev").AddComponent <Dev>();
         }
     }
 }
Example #2
0
        private void Start()
        {
            foreach (var other in FindObjectsOfType <Dev>())
            {
                if (other != this)
                {
                    DestroyImmediate(other);
                }
            }

            if (_showGui)
            {
                onOpenGui();
            }

            _devInstance = this;
            DontDestroyOnLoad(gameObject);
        }