更新S2交互

This commit is contained in:
YXY
2026-03-06 18:51:18 +08:00
parent 3e39007e2c
commit 6465387a45
281 changed files with 86957 additions and 206 deletions

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: ac04a748e131e924c9dff6041373cc41
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 1d2bece8a9d1b6d48ba82d3ee2ccab2f
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 740f51a1ac4b42088297287229057627, type: 3}
m_Name: Fist Bump
m_EditorClassIdentifier:
m_HandShape: {fileID: 11400000, guid: 15192c14370865d49a51f59cf120c1aa, type: 2}
m_RelativeOrientation:
m_UserConditions:
- m_HandAxis: 1
m_AlignmentCondition: 1
m_ReferenceDirection: 1
m_AngleTolerance: 60
m_IgnorePositionY: 0
m_TargetConditions: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 99873d76c6dc0814a860bc3167808296
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,50 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5fb3781030442f2bcc893f0dbffabc5, type: 3}
m_Name: Fist Hand Shape
m_EditorClassIdentifier:
m_FingerShapeConditions:
- m_FingerID: 1
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.3
m_LowerTolerance: 0.3
m_Tolerance: 0
m_Desired: 1
- m_FingerID: 2
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.3
m_LowerTolerance: 0.3
m_Tolerance: 0
m_Desired: 1
- m_FingerID: 3
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.3
m_LowerTolerance: 0.3
m_Tolerance: 0
m_Desired: 1
- m_FingerID: 4
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.4
m_LowerTolerance: 0.4
m_Tolerance: 0
m_Desired: 1
- m_FingerID: 0
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.45
m_LowerTolerance: 0.45
m_Tolerance: 0
m_Desired: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: c7eb0bc53e998304b8f14efe38769c5c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,50 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5fb3781030442f2bcc893f0dbffabc5, type: 3}
m_Name: Open Hand Shape
m_EditorClassIdentifier:
m_FingerShapeConditions:
- m_FingerID: 1
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.5
m_LowerTolerance: 0.4
m_Tolerance: 0
m_Desired: 0
- m_FingerID: 0
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.5
m_LowerTolerance: 0.5
m_Tolerance: 0
m_Desired: 0
- m_FingerID: 2
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.45
m_LowerTolerance: 0.4
m_Tolerance: 0
m_Desired: 0
- m_FingerID: 3
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.45
m_LowerTolerance: 0.4
m_Tolerance: 0
m_Desired: 0
- m_FingerID: 4
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.4
m_LowerTolerance: 0.4
m_Tolerance: 0
m_Desired: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 4833fb8fae2d5cb4da5b426211bc477c
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 740f51a1ac4b42088297287229057627, type: 3}
m_Name: Open Palm Up
m_EditorClassIdentifier:
m_HandShape: {fileID: 11400000, guid: f1a6c40e8017f4240bfaedcd2e5e5913, type: 2}
m_RelativeOrientation:
m_UserConditions:
- m_HandAxis: 0
m_AlignmentCondition: 0
m_ReferenceDirection: 1
m_AngleTolerance: 60
m_IgnorePositionY: 0
m_TargetConditions: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e6b44926ecec25e4d95d7fea5cbc1590
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 740f51a1ac4b42088297287229057627, type: 3}
m_Name: Fist Bump
m_EditorClassIdentifier:
m_HandShape: {fileID: 11400000, guid: 15192c14370865d49a51f59cf120c1aa, type: 2}
m_RelativeOrientation:
m_UserConditions:
- m_HandAxis: 2
m_AlignmentCondition: 1
m_ReferenceDirection: 0
m_AngleTolerance: 60
m_IgnorePositionY: 0
m_TargetConditions: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 076f4c25feef28544ab83d454d3e0221
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,50 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5fb3781030442f2bcc893f0dbffabc5, type: 3}
m_Name: Fist Hand Shape
m_EditorClassIdentifier:
m_FingerShapeConditions:
- m_FingerID: 1
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.3
m_LowerTolerance: 0.3
m_Tolerance: 0
m_Desired: 1
- m_FingerID: 2
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.3
m_LowerTolerance: 0.3
m_Tolerance: 0
m_Desired: 1
- m_FingerID: 3
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.3
m_LowerTolerance: 0.3
m_Tolerance: 0
m_Desired: 1
- m_FingerID: 4
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.4
m_LowerTolerance: 0.4
m_Tolerance: 0
m_Desired: 1
- m_FingerID: 0
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.45
m_LowerTolerance: 0.45
m_Tolerance: 0
m_Desired: 1

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 15192c14370865d49a51f59cf120c1aa
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,50 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d5fb3781030442f2bcc893f0dbffabc5, type: 3}
m_Name: Open Hand Shape
m_EditorClassIdentifier:
m_FingerShapeConditions:
- m_FingerID: 1
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.5
m_LowerTolerance: 0.4
m_Tolerance: 0
m_Desired: 0
- m_FingerID: 0
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.5
m_LowerTolerance: 0.5
m_Tolerance: 0
m_Desired: 0
- m_FingerID: 2
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.45
m_LowerTolerance: 0.4
m_Tolerance: 0
m_Desired: 0
- m_FingerID: 3
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.45
m_LowerTolerance: 0.4
m_Tolerance: 0
m_Desired: 0
- m_FingerID: 4
m_Targets:
- m_ShapeType: 0
m_UpperTolerance: 0.4
m_LowerTolerance: 0.4
m_Tolerance: 0
m_Desired: 0

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: f1a6c40e8017f4240bfaedcd2e5e5913
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,23 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &11400000
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 740f51a1ac4b42088297287229057627, type: 3}
m_Name: Open Palm Up
m_EditorClassIdentifier:
m_HandShape: {fileID: 11400000, guid: f1a6c40e8017f4240bfaedcd2e5e5913, type: 2}
m_RelativeOrientation:
m_UserConditions:
- m_HandAxis: 0
m_AlignmentCondition: 0
m_ReferenceDirection: 0
m_AngleTolerance: 60
m_IgnorePositionY: 0
m_TargetConditions: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 746a5d1e92598204797ea29c09d89948
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 11400000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: e354b812d35225a49bf340d6eae3ce56
folderAsset: yes
DefaultImporter:
externalObjects: {}
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -0,0 +1,133 @@
%YAML 1.1
%TAG !u! tag:unity3d.com,2011:
--- !u!114 &-5676698204600369070
MonoBehaviour:
m_ObjectHideFlags: 11
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 0}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: d0353a89b1f911e48b9e16bdc9f2e058, type: 3}
m_Name:
m_EditorClassIdentifier:
version: 7
--- !u!21 &2100000
Material:
serializedVersion: 8
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_Name: Hand Material
m_Shader: {fileID: 4800000, guid: 933532a4fcc9baf4fa0491de14d08ed7, type: 3}
m_Parent: {fileID: 0}
m_ModifiedSerializedProperties: 0
m_ValidKeywords: []
m_InvalidKeywords: []
m_LightmapFlags: 4
m_EnableInstancingVariants: 0
m_DoubleSidedGI: 0
m_CustomRenderQueue: -1
stringTagMap:
RenderType: Opaque
disabledShaderPasses: []
m_LockedProperties:
m_SavedProperties:
serializedVersion: 3
m_TexEnvs:
- _BaseMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _BumpMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailAlbedoMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailMask:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _DetailNormalMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _EmissionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MainTex:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _MetallicGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _OcclusionMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _ParallaxMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- _SpecGlossMap:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_Lightmaps:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_LightmapsInd:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
- unity_ShadowMasks:
m_Texture: {fileID: 0}
m_Scale: {x: 1, y: 1}
m_Offset: {x: 0, y: 0}
m_Ints: []
m_Floats:
- _AlphaClip: 0
- _AlphaToMask: 0
- _Blend: 0
- _BlendModePreserveSpecular: 1
- _BumpScale: 1
- _ClearCoatMask: 0
- _ClearCoatSmoothness: 0
- _Cull: 2
- _Cutoff: 0.5
- _DetailAlbedoMapScale: 1
- _DetailNormalMapScale: 1
- _DstBlend: 0
- _DstBlendAlpha: 0
- _EnvironmentReflections: 1
- _GlossMapScale: 0
- _Glossiness: 0
- _GlossyReflections: 0
- _Metallic: 0
- _OcclusionStrength: 1
- _Parallax: 0.005
- _QueueOffset: 0
- _ReceiveShadows: 1
- _Smoothness: 0.5
- _SmoothnessTextureChannel: 0
- _SpecularHighlights: 1
- _SrcBlend: 1
- _SrcBlendAlpha: 1
- _Surface: 0
- _WorkflowMode: 1
- _ZWrite: 1
m_Colors:
- _BaseColor: {r: 1, g: 1, b: 1, a: 1}
- _Color: {r: 1, g: 1, b: 1, a: 1}
- _EmissionColor: {r: 0, g: 0, b: 0, a: 1}
- _SpecColor: {r: 0.19999996, g: 0.19999996, b: 0.19999996, a: 1}
m_BuildTextureStacks: []

View File

@@ -0,0 +1,8 @@
fileFormatVersion: 2
guid: 62002129a8919c84a95d968c3dae5014
NativeFormatImporter:
externalObjects: {}
mainObjectFileID: 2100000
userData:
assetBundleName:
assetBundleVariant:

View File

@@ -1,33 +1,74 @@
using System.Collections;
using UnityEngine;
using UnityEngine.XR.Interaction.Toolkit;
using BigSpace.XRCore.Event;
using BigSpace.Logic;
public class QuadCatchCtr : MonoBehaviour
{
private UnityEngine.XR.Interaction.Toolkit.Interactors.XRRayInteractor rayInteractor;
void Start()
{
rayInteractor = GetComponent<UnityEngine.XR.Interaction.Toolkit.Interactors.XRRayInteractor>();
rayInteractor.selectEntered.AddListener(OnSelectEntered);
rayInteractor.selectExited.AddListener(OnSelectExited);
}
public class QuadCatchCtr : MonoBehaviour
{
[Header("检测设置")]
[SerializeField] private float rayLength = 50f;
[SerializeField] private LayerMask detectionLayer;
// 握拳时射线命中 Quad → 抓到了
void OnSelectEntered(SelectEnterEventArgs args)
{
string name = args.interactableObject.transform.gameObject.name;
if (name.Length >= 4 && name.Substring(0, 4) == "Quad")
{
int fontIndex = int.Parse(name.Substring(4));
// 替换成新 SDK 的事件派发
GlobalEventMgr.Dispatch(GameEvent.EventRayQuadOk, true, 2, fontIndex);
}
}
[Tooltip("张开手丢失后保持就绪的宽限时间(秒),避免手势过渡时漏判")]
[SerializeField] private float readyGracePeriod = 0.3f;
// 松手
void OnSelectExited(SelectExitEventArgs args)
{
GlobalEventMgr.Dispatch(GameEvent.EventHandRelease, 2);
}
}
private bool m_isReady = false;
private bool m_isCatching = false;
private Coroutine m_graceCoroutine;
// ── 张开手 StaticHandGesture ────────────────────────────────
public void OnOpenHandDetected()
{
// 取消正在倒计时的宽限期
if (m_graceCoroutine != null)
{
StopCoroutine(m_graceCoroutine);
m_graceCoroutine = null;
}
m_isReady = true;
}
public void OnOpenHandLost()
{
// 不立即清除,给握拳手势留过渡窗口
m_graceCoroutine = StartCoroutine(ClearReadyAfterDelay());
}
private IEnumerator ClearReadyAfterDelay()
{
yield return new WaitForSeconds(readyGracePeriod);
if (!m_isCatching)
m_isReady = false;
m_graceCoroutine = null;
}
// ── 握拳 StaticHandGesture ──────────────────────────────────
public void OnFistDetected()
{
if (!m_isReady || m_isCatching) return;
// 相机视线射线验证
Camera cam = Camera.main;
Ray ray = new Ray(cam.transform.position, cam.transform.forward);
if (!Physics.Raycast(ray, out RaycastHit hit, rayLength, detectionLayer))
return;
string hitName = hit.collider.gameObject.name;
if (hitName.Length < 5 || hitName.Substring(0, 4) != "Quad") return;
if (!int.TryParse(hitName.Substring(4), out int fontIndex)) return;
m_isCatching = true;
GlobalEventMgr.Dispatch(GameEvent.EventRayQuadOk, true, 2, fontIndex);
}
public void OnFistLost()
{
if (!m_isCatching) return;
m_isCatching = false;
m_isReady = false;
GlobalEventMgr.Dispatch(GameEvent.EventHandRelease, 2);
}
}