Beispiel #1
0
 private static AutoTune GetInstance()
 {
     if (_instance == null)
     {
         _instance = UnityEngine.Object.FindObjectOfType <AutoTune>();
         if (_instance == null)
         {
             GameObject gameObject = new GameObject("AutoTune");
             _instance            = gameObject.AddComponent <AutoTune>();
             _prInstance          = gameObject.AddComponent <PerfRecorder>();
             gameObject.hideFlags = HideFlags.HideAndDontSave;
         }
         UnityEngine.Object.DontDestroyOnLoad(_instance.gameObject);
     }
     return(_instance);
 }
 static AutoTune GetInstance()
 {
     if (_instance == null)
     {
         _instance = FindObjectOfType <AutoTune>();
         if (_instance == null)
         {
             var gO = new GameObject("AutoTune");
             _instance    = gO.AddComponent <AutoTune>();
             _prInstance  = gO.AddComponent <PerfRecorder>();
             gO.hideFlags = HideFlags.HideAndDontSave;
         }
         DontDestroyOnLoad(_instance.gameObject);
     }
     return(_instance);
 }