Hi, in my works to try to understand why the HMD crashes when we switch to another scene, I have started to do some refactoring/optimization.
First of all, this code is used in a real project already in production on multiple environements (PC, Android, Web)
Using a string for Start/StopCoroutine is not very good for performances (check the Unity docs), so I used a variable to store a reference to the EndOfFrame method.
Finally it is not necessary to spam the console if the ClientKit object is not present on the scene, so I added another flag to display a message one time only.
Hi, in my works to try to understand why the HMD crashes when we switch to another scene, I have started to do some refactoring/optimization.
First of all, this code is used in a real project already in production on multiple environements (PC, Android, Web)
Using a string for
Start/StopCoroutine
is not very good for performances (check the Unity docs), so I used a variable to store a reference to theEndOfFrame
method.Finally it is not necessary to spam the console if the
ClientKit
object is not present on the scene, so I added another flag to display a message one time only.