CurvedUIEventSystem.cs 561 B

123456789101112131415161718192021222324252627282930
  1. using UnityEngine.EventSystems;
  2. namespace CurvedUI
  3. {
  4. /// <summary>
  5. /// Fixes the issue where UI input would stop working in VR if the game window looses focus.
  6. /// </summary>
  7. public class CurvedUIEventSystem : EventSystem
  8. {
  9. public static CurvedUIEventSystem instance;
  10. protected override void Awake()
  11. {
  12. base.Awake();
  13. instance = this;
  14. }
  15. protected override void OnApplicationFocus(bool hasFocus)
  16. {
  17. base.OnApplicationFocus(true);
  18. }
  19. }
  20. }