StandaloneSubsystem.cs 933 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. namespace UnityEngine.XR.Management.Tests.Standalone
  3. {
  4. public class StandaloneSubsystem : Subsystem
  5. {
  6. private bool isRunning = false;
  7. public override bool running
  8. {
  9. get
  10. {
  11. return isRunning;
  12. }
  13. }
  14. public event Action startCalled;
  15. public event Action stopCalled;
  16. public event Action destroyCalled;
  17. public override void Start()
  18. {
  19. isRunning = true;
  20. if (startCalled != null)
  21. startCalled.Invoke();
  22. }
  23. public override void Stop()
  24. {
  25. isRunning = false;
  26. if (stopCalled != null)
  27. stopCalled.Invoke();
  28. }
  29. protected override void OnDestroy()
  30. {
  31. isRunning = false;
  32. if (destroyCalled != null)
  33. destroyCalled.Invoke();
  34. }
  35. }
  36. }