using System; using System.Collections.Generic; using System.Linq; using System.Text; using System.Threading.Tasks; using UnityEngine; namespace SC.XR.Unity.Module_InputSystem.InputDeviceGC { public class InputDeviceGCPartEventBattery : InputDeviceGCPartEventBase { InputDevicePartDispatchEventGC inputDevicePartDispatchEventGC; public InputDeviceGCPartEventBattery(InputDevicePartDispatchEventGC inputDevicePartDispatchEventGC) : base(inputDevicePartDispatchEventGC) { this.inputDevicePartDispatchEventGC = inputDevicePartDispatchEventGC; } private int perBatteryLevel = 0; public override void OnSCStart() { base.OnSCStart(); perBatteryLevel = inputDevicePartDispatchEventGC.inputDeviceGCPart.inputDataGC.BatteryPower; } protected override void OnUpdateEvent() { currentEvent = GCEventType.Null; if (perBatteryLevel != inputDevicePartDispatchEventGC.inputDeviceGCPart.inputDataGC.BatteryPower) { perBatteryLevel = inputDevicePartDispatchEventGC.inputDeviceGCPart.inputDataGC.BatteryPower; currentEvent = GCEventType.BATTERY_POWER_CHANGE; } } } }