上传YomovSDK

This commit is contained in:
Sora丶kong
2026-03-03 03:15:46 +08:00
parent 9096da7e6c
commit eb97f31065
6477 changed files with 1932208 additions and 3 deletions

View File

@@ -0,0 +1,21 @@
using UnityEngine.UI;
using UnityEngine.InputSystem;
namespace UnityEngine.XR.OpenXR.Samples.ControllerSample
{
public class ActionToVector2 : ActionToControl
{
[SerializeField] public RectTransform _handle = null;
protected override void OnActionPerformed(InputAction.CallbackContext ctx) => UpdateHandle(ctx);
protected override void OnActionStarted(InputAction.CallbackContext ctx) => UpdateHandle(ctx);
protected override void OnActionCanceled(InputAction.CallbackContext ctx) => UpdateHandle(ctx);
private void UpdateHandle(InputAction.CallbackContext ctx)
{
_handle.anchorMin = _handle.anchorMax = (ctx.ReadValue<Vector2>() + Vector2.one) * 0.5f;
}
}
}