public void Update(InputDevice device) { isPressed = XRStatics.IsPressed(device, button); bool active = false; switch (pressType) { case PressType.Continuous: active = isPressed; break; case PressType.Down: active = isPressed && !wasPressed; break; case PressType.Up: active = !isPressed && wasPressed; break; } if (active) { OnActive.Invoke(); } wasPressed = isPressed; }