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

            if (_instance == null)
            {
                _instance = FindObjectOfType <Benchmarking>();

                if (_instance == null)
                {
                    var gO = new GameObject("Benchmarking");
                    _instance    = gO.AddComponent <Benchmarking>();
                    gO.hideFlags = HideFlags.HideAndDontSave;
                }

                DontDestroyOnLoad(_instance.gameObject);
            }

            return(_instance);
        }
Beispiel #3
0
 public float StopTimer()
 {
     return(Benchmarking.StopTimer());
 }
Beispiel #4
0
 public void StartTimer(string context)
 {
     Benchmarking.StartTimer(context);
 }
Beispiel #5
0
 public AsyncOperation LoadSceneAsync(string sceneName, LoadSceneMode mode)
 {
     return(Benchmarking.LoadSceneAsync(sceneName, mode));
 }
Beispiel #6
0
 public AsyncOperation LoadSceneAsync(int sceneBuildIndex, LoadSceneMode mode)
 {
     return(Benchmarking.LoadSceneAsync(sceneBuildIndex, mode));
 }
Beispiel #7
0
 public void LoadScene(string sceneName, LoadSceneMode mode)
 {
     Benchmarking.LoadScene(sceneName, mode);
 }
Beispiel #8
0
 public void LoadScene(string sceneName)
 {
     Benchmarking.LoadScene(sceneName);
 }
Beispiel #9
0
 public void LoadScene(int sceneBuildIndex, LoadSceneMode mode)
 {
     Benchmarking.LoadScene(sceneBuildIndex);
 }
Beispiel #10
0
 public void EndExperiment()
 {
     Benchmarking.EndExperiment();
     Benchmarking.Finished();
 }
Beispiel #11
0
 public void BeginExperiment(string experimentName)
 {
     Benchmarking.BeginExperiment(experimentName);
 }
Beispiel #12
0
 /// <summary>
 /// Ends the experiment that collects estimated dropped frames as well
 /// as a histogram of miliseconds per frame.
 /// </summary>
 public void EndExperiment(string experimentName)
 {
     Benchmarking.EndExperiment(experimentName);
     Benchmarking.Finished(experimentName);
 }
Beispiel #13
0
 public void ClearAllResults()
 {
     Benchmarking.Clear();
 }
Beispiel #14
0
 /// <summary>
 /// Stops all generic timers.
 /// </summary>
 public void StopAllTimers()
 {
     Benchmarking.StopAllTimers();
 }
Beispiel #15
0
 /// <summary>
 /// Stops the generic timer.
 /// </summary>
 /// <returns>The time elapsed in milliseconds.</returns>
 /// <param name="context">Context.</param>
 public float StopTimer(string context)
 {
     return(Benchmarking.StopTimer(context));
 }