12345678910111213141516171819202122232425262728293031323334353637383940414243444546 |
- using SC.XR.Unity.Module_InputSystem.InputDeviceGC;
- using SC.XR.Unity.Module_InputSystem.InputDeviceGC.KS;
- using System.Collections;
- using System.Collections.Generic;
- using UnityEngine;
- public class ControllerData : MonoBehaviour
- {
- public TextMesh text;
- int eventNum = 0;
- // Start is called before the first frame update
- void Start()
- {
- eventNum = 0;
- InputDeviceGCPartEventBase.eventDelegate += ControllerEvent;
- }
- void OnDestroy() {
- InputDeviceGCPartEventBase.eventDelegate -= ControllerEvent;
- }
- void ControllerEvent(GCEventType aEvent, InputDeviceGCPart GCPart) {
- if (text==null)
- return;
- eventNum++;
- text.text += "\n" + eventNum + " - " + GCPart.PartType + ": " + aEvent;
- if (aEvent == GCEventType.Connect) {
- } else if (aEvent == GCEventType.DisConnect) {
- } else if (aEvent == GCEventType.BATTERY_POWER_CHANGE) {
- text.text += ": "+GCPart.inputDataGC.BatteryPower;
- } else if (aEvent == GCEventType.BATTERY_STATUS_CHARGING) {
- } else if (aEvent == GCEventType.BATTERY_STATUS_DISCHARGING) {
- }
- Debug.Log("KS -- ControllerData:" + eventNum + " - " + GCPart.PartType + ": " + aEvent + " "+ GCPart.inputDataGC.BatteryPower);
- }
- }
|