InputDeviceBT3Dof.cs 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using UnityEngine;
  7. namespace SC.XR.Unity.Module_InputSystem.InputDeviceGC.BT3Dof {
  8. public class InputDeviceBT3Dof : InputDeviceGC {
  9. public override InputDeviceType inputDeviceType {
  10. get {
  11. return InputDeviceType.BT3Dof;
  12. }
  13. }
  14. public BT3DofConnectListener bT3DofConnectListener;
  15. public override void OnSCAwake() {
  16. base.OnSCAwake();
  17. if(Application.platform == RuntimePlatform.Android) {
  18. bT3DofConnectListener = new BT3DofConnectListener(this);
  19. AndroidPluginBase.ObjectAddListener(AndroidPluginBT3Dof.BT3DofManager, "setHandShankConnStateCallback", bT3DofConnectListener);
  20. }
  21. }
  22. public override void OnSCDestroy() {
  23. base.OnSCDestroy();
  24. bT3DofConnectListener = null;
  25. if(Application.platform == RuntimePlatform.Android) {
  26. AndroidPluginBase.ObjectAddListener(AndroidPluginBT3Dof.BT3DofManager, "setHandShankConnStateCallback", null);
  27. }
  28. }
  29. }
  30. }