From d3ebee57284f380b19bedc2661355257d80608b8 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Fri, 28 Mar 2025 14:20:09 +0800 Subject: [PATCH 1/7] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=86=B2=E7=AA=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Art/Fonts/PingFang Medium SDF.asset.meta | 2 +- .../PingFangSC-Medium SDF.asset.meta | 2 +- Assets/Art/UIPrefab/UI3DObjShow.prefab | 6 +- Assets/Art/UIPrefab/UIInstruction.prefab | 22 +- Assets/Art/UIPrefab/UIOperationList.prefab | 2 +- Assets/Art/UIPrefab/UISetting.prefab | 200 ++++++++++++++---- Packages/manifest.json | 3 +- Packages/packages-lock.json | 7 + 8 files changed, 181 insertions(+), 63 deletions(-) diff --git a/Assets/Art/Fonts/PingFang Medium SDF.asset.meta b/Assets/Art/Fonts/PingFang Medium SDF.asset.meta index 216ca8c0..a8066baa 100644 --- a/Assets/Art/Fonts/PingFang Medium SDF.asset.meta +++ b/Assets/Art/Fonts/PingFang Medium SDF.asset.meta @@ -4,5 +4,5 @@ NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 userData: - assetBundleName: + assetBundleName: pingfang medium sdf_asset assetBundleVariant: diff --git a/Assets/Art/Fonts/pingfangSc/PingFangSC-Medium SDF.asset.meta b/Assets/Art/Fonts/pingfangSc/PingFangSC-Medium SDF.asset.meta index 6ff52c9c..80771010 100644 --- a/Assets/Art/Fonts/pingfangSc/PingFangSC-Medium SDF.asset.meta +++ b/Assets/Art/Fonts/pingfangSc/PingFangSC-Medium SDF.asset.meta @@ -4,5 +4,5 @@ NativeFormatImporter: externalObjects: {} mainObjectFileID: 11400000 userData: - assetBundleName: + assetBundleName: pingfangsc-medium sdf_asset assetBundleVariant: diff --git a/Assets/Art/UIPrefab/UI3DObjShow.prefab b/Assets/Art/UIPrefab/UI3DObjShow.prefab index 1eaea369..b3429571 100644 --- a/Assets/Art/UIPrefab/UI3DObjShow.prefab +++ b/Assets/Art/UIPrefab/UI3DObjShow.prefab @@ -457,7 +457,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: Right CustomComment: mComponentName: UnityEngine.UI.Image --- !u!1 &3408871029033640143 @@ -581,7 +581,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: Scroll CustomComment: mComponentName: UnityEngine.UI.ScrollRect --- !u!1 &4561816282390826745 @@ -835,7 +835,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: ObjBg CustomComment: mComponentName: UnityEngine.UI.RawImage --- !u!1 &6831573971870136393 diff --git a/Assets/Art/UIPrefab/UIInstruction.prefab b/Assets/Art/UIPrefab/UIInstruction.prefab index 27948151..0fe0334d 100644 --- a/Assets/Art/UIPrefab/UIInstruction.prefab +++ b/Assets/Art/UIPrefab/UIInstruction.prefab @@ -100,7 +100,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: Training CustomComment: mComponentName: UnityEngine.UI.Toggle --- !u!1 &511604240533759376 @@ -439,7 +439,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: TrainContent CustomComment: mComponentName: RectTransform --- !u!1 &1854468325030962358 @@ -782,7 +782,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: Operation CustomComment: mComponentName: UnityEngine.UI.Toggle --- !u!1 &2570030987872014484 @@ -1018,8 +1018,8 @@ MonoBehaviour: m_Calls: [] m_text: "\u5B9E\u8BAD\u8BF4\u660E" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} - m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_fontAsset: {fileID: 11400000, guid: e7da174c677019b49aa681250aa4ded8, type: 2} + m_sharedMaterial: {fileID: -7878122246201655599, guid: e7da174c677019b49aa681250aa4ded8, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -1473,7 +1473,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: OperationContent CustomComment: mComponentName: UnityEngine.UI.Image --- !u!1 &4068472154838936528 @@ -1611,7 +1611,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: ConfirmBtn CustomComment: mComponentName: UnityEngine.UI.Button --- !u!1 &4098278228048021229 @@ -1750,7 +1750,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: NoToggle CustomComment: mComponentName: UnityEngine.UI.Toggle --- !u!1 &5793951295459804211 @@ -2097,8 +2097,8 @@ MonoBehaviour: m_Calls: [] m_text: "\u64CD\u4F5C\u8BF4\u660E" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} - m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_fontAsset: {fileID: 11400000, guid: e7da174c677019b49aa681250aa4ded8, type: 2} + m_sharedMaterial: {fileID: -7878122246201655599, guid: e7da174c677019b49aa681250aa4ded8, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -2387,7 +2387,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: ContentText CustomComment: mComponentName: TMPro.TextMeshProUGUI --- !u!1 &8662634946358023954 diff --git a/Assets/Art/UIPrefab/UIOperationList.prefab b/Assets/Art/UIPrefab/UIOperationList.prefab index 0177b348..9101077e 100644 --- a/Assets/Art/UIPrefab/UIOperationList.prefab +++ b/Assets/Art/UIPrefab/UIOperationList.prefab @@ -972,7 +972,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: StepContent CustomComment: mComponentName: RectTransform --- !u!1 &5682155547481945418 diff --git a/Assets/Art/UIPrefab/UISetting.prefab b/Assets/Art/UIPrefab/UISetting.prefab index b8c81173..18d356a9 100644 --- a/Assets/Art/UIPrefab/UISetting.prefab +++ b/Assets/Art/UIPrefab/UISetting.prefab @@ -134,7 +134,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: VoiceAdd CustomComment: mComponentName: UnityEngine.UI.Button --- !u!1 &340564367494795038 @@ -355,8 +355,8 @@ MonoBehaviour: m_Calls: [] m_text: "\u97F3\u91CF\u8C03\u8282" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} - m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_fontAsset: {fileID: 11400000, guid: e7da174c677019b49aa681250aa4ded8, type: 2} + m_sharedMaterial: {fileID: -7878122246201655599, guid: e7da174c677019b49aa681250aa4ded8, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -489,8 +489,8 @@ MonoBehaviour: m_Calls: [] m_text: "\u9F20\u6807\u7075\u654F\u5EA6" m_isRightToLeft: 0 - m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} - m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_fontAsset: {fileID: 11400000, guid: e7da174c677019b49aa681250aa4ded8, type: 2} + m_sharedMaterial: {fileID: -7878122246201655599, guid: e7da174c677019b49aa681250aa4ded8, type: 2} m_fontSharedMaterials: [] m_fontMaterial: {fileID: 0} m_fontMaterials: [] @@ -566,7 +566,7 @@ GameObject: m_Component: - component: {fileID: 4603449952944263616} - component: {fileID: 2111290541918366963} - - component: {fileID: 8794892031925789476} + - component: {fileID: 1909886951280785919} m_Layer: 5 m_Name: Text m_TagString: Untagged @@ -601,7 +601,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 1275590828871288331} m_CullTransparentMesh: 1 ---- !u!114 &8794892031925789476 +--- !u!114 &1909886951280785919 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -610,7 +610,7 @@ MonoBehaviour: m_GameObject: {fileID: 1275590828871288331} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} @@ -621,20 +621,75 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_FontData: - m_Font: {fileID: 12800000, guid: 20ebdb412ee9aec4a9d3005965d9c962, type: 3} - m_FontSize: 16 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 1 - m_MaxSize: 40 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: "\u786E\u5B9A" + m_text: "\u786E\u5B9A" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: e7da174c677019b49aa681250aa4ded8, type: 2} + m_sharedMaterial: {fileID: -7878122246201655599, guid: e7da174c677019b49aa681250aa4ded8, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 16 + m_fontSizeBase: 16 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &1291984167039376258 GameObject: m_ObjectHideFlags: 0 @@ -782,7 +837,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: ConfirmBtn CustomComment: mComponentName: UnityEngine.UI.Button --- !u!1 &1336234533568578533 @@ -958,7 +1013,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: MouseSub CustomComment: mComponentName: UnityEngine.UI.Button --- !u!1 &2445174993273300670 @@ -1298,7 +1353,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: MouseAdd CustomComment: mComponentName: UnityEngine.UI.Button --- !u!1 &4566101257233310026 @@ -1710,7 +1765,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: MouseSlider CustomComment: mComponentName: UnityEngine.UI.Slider --- !u!1 &6857310105801723508 @@ -1723,7 +1778,7 @@ GameObject: m_Component: - component: {fileID: 8694246342311846549} - component: {fileID: 8710041809518762022} - - component: {fileID: 8821581120829563032} + - component: {fileID: 3366047067339770762} m_Layer: 5 m_Name: TitleTxt m_TagString: Untagged @@ -1758,7 +1813,7 @@ CanvasRenderer: m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 6857310105801723508} m_CullTransparentMesh: 1 ---- !u!114 &8821581120829563032 +--- !u!114 &3366047067339770762 MonoBehaviour: m_ObjectHideFlags: 0 m_CorrespondingSourceObject: {fileID: 0} @@ -1767,7 +1822,7 @@ MonoBehaviour: m_GameObject: {fileID: 6857310105801723508} m_Enabled: 1 m_EditorHideFlags: 0 - m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3} + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} @@ -1778,20 +1833,75 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_FontData: - m_Font: {fileID: 12800000, guid: bf708833e50b7a746aa577360930b6ed, type: 3} - m_FontSize: 20 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 1 - m_MaxSize: 40 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: "\u8BBE\u7F6E" + m_text: "\u8BBE\u7F6E" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: e7da174c677019b49aa681250aa4ded8, type: 2} + m_sharedMaterial: {fileID: -7878122246201655599, guid: e7da174c677019b49aa681250aa4ded8, type: 2} + m_fontSharedMaterials: [] + m_fontMaterial: {fileID: 0} + m_fontMaterials: [] + m_fontColor32: + serializedVersion: 2 + rgba: 4294967295 + m_fontColor: {r: 1, g: 1, b: 1, a: 1} + m_enableVertexGradient: 0 + m_colorMode: 3 + m_fontColorGradient: + topLeft: {r: 1, g: 1, b: 1, a: 1} + topRight: {r: 1, g: 1, b: 1, a: 1} + bottomLeft: {r: 1, g: 1, b: 1, a: 1} + bottomRight: {r: 1, g: 1, b: 1, a: 1} + m_fontColorGradientPreset: {fileID: 0} + m_spriteAsset: {fileID: 0} + m_tintAllSprites: 0 + m_StyleSheet: {fileID: 0} + m_TextStyleHashCode: -1183493901 + m_overrideHtmlColors: 0 + m_faceColor: + serializedVersion: 2 + rgba: 4294967295 + m_fontSize: 20 + m_fontSizeBase: 20 + m_fontWeight: 400 + m_enableAutoSizing: 0 + m_fontSizeMin: 18 + m_fontSizeMax: 72 + m_fontStyle: 0 + m_HorizontalAlignment: 2 + m_VerticalAlignment: 512 + m_textAlignment: 65535 + m_characterSpacing: 0 + m_wordSpacing: 0 + m_lineSpacing: 0 + m_lineSpacingMax: 0 + m_paragraphSpacing: 0 + m_charWidthMaxAdj: 0 + m_enableWordWrapping: 1 + m_wordWrappingRatios: 0.4 + m_overflowMode: 0 + m_linkedTextComponent: {fileID: 0} + parentLinkedComponent: {fileID: 0} + m_enableKerning: 1 + m_enableExtraPadding: 0 + checkPaddingRequired: 0 + m_isRichText: 1 + m_parseCtrlCharacters: 1 + m_isOrthographic: 1 + m_isCullingEnabled: 0 + m_horizontalMapping: 0 + m_verticalMapping: 0 + m_uvLineOffset: 0 + m_geometrySortingOrder: 0 + m_IsTextObjectScaleStatic: 0 + m_VertexBufferAutoSizeReduction: 0 + m_useMaxVisibleDescender: 1 + m_pageToDisplay: 1 + m_margin: {x: 0, y: 0, z: 0, w: 0} + m_isUsingLegacyAnimationComponent: 0 + m_isVolumetricText: 0 + m_hasFontAssetChanged: 0 + m_baseMaterial: {fileID: 0} + m_maskOffset: {x: 0, y: 0, z: 0, w: 0} --- !u!1 &7344084794051543825 GameObject: m_ObjectHideFlags: 0 @@ -1926,7 +2036,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: VoiceSub CustomComment: mComponentName: UnityEngine.UI.Button --- !u!1 &7441298961810434495 @@ -2105,7 +2215,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: VoiceSlider CustomComment: mComponentName: UnityEngine.UI.Slider --- !u!1 &8015440409360597658 diff --git a/Packages/manifest.json b/Packages/manifest.json index b2eb2420..1d80c3dc 100644 --- a/Packages/manifest.json +++ b/Packages/manifest.json @@ -44,6 +44,7 @@ "com.unity.modules.video": "1.0.0", "com.unity.modules.vr": "1.0.0", "com.unity.modules.wind": "1.0.0", - "com.unity.modules.xr": "1.0.0" + "com.unity.modules.xr": "1.0.0", + "com.unity.assetbundlebrowser": "1.7.0" } } diff --git a/Packages/packages-lock.json b/Packages/packages-lock.json index b03adf1b..f0d22f42 100644 --- a/Packages/packages-lock.json +++ b/Packages/packages-lock.json @@ -15,6 +15,13 @@ "com.unity.modules.uielements": "1.0.0" } }, + "com.unity.assetbundlebrowser": { + "version": "1.7.0", + "depth": 0, + "source": "registry", + "dependencies": {}, + "url": "https://packages.unity.cn" + }, "com.unity.burst": { "version": "1.8.11", "depth": 1, From 806bd0d4046f83c9931db1e5e300bd0ac6b60833 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 31 Mar 2025 08:39:35 +0800 Subject: [PATCH 2/7] =?UTF-8?q?=E5=A2=9E=E5=8A=A0VR=E7=9B=B8=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UIKit/Scripts/Resources/VRUIRoot.prefab | 14 +++++------ Assets/Scripts/Extension/DeviceDraggable.cs | 24 +++++++++++++++++++ .../Scripts/Extension/DeviceDraggable.cs.meta | 11 +++++++++ Assets/Scripts/Item/DeviceItem.cs | 2 ++ Assets/WebPlatform.meta | 8 +++++++ 5 files changed, 52 insertions(+), 7 deletions(-) create mode 100644 Assets/Scripts/Extension/DeviceDraggable.cs create mode 100644 Assets/Scripts/Extension/DeviceDraggable.cs.meta create mode 100644 Assets/WebPlatform.meta diff --git a/Assets/QFramework/Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab b/Assets/QFramework/Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab index 343b267b..7fc3f886 100644 --- a/Assets/QFramework/Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab +++ b/Assets/QFramework/Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab @@ -123,8 +123,8 @@ Transform: m_GameObject: {fileID: 598348144801550191} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0.1465, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalPosition: {x: 0, y: 2.1975, z: 0} + m_LocalScale: {x: 15, y: 15, z: 15} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 5974269590546671381} @@ -144,7 +144,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Frame: {fileID: 6717849271440217812} - ViewerScale: 1 + ViewerScale: 15 --- !u!1 &765259898297824089 GameObject: m_ObjectHideFlags: 0 @@ -174,7 +174,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} + m_LocalScale: {x: 15, y: 15, z: 15} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 964729101505013327} @@ -192,7 +192,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b20817e9db276aa4182f6e0885aa2ddf, type: 3} m_Name: m_EditorClassIdentifier: - ViewerScale: 1 + ViewerScale: 15 --- !u!114 &2720570802681005941 MonoBehaviour: m_ObjectHideFlags: 0 @@ -634,7 +634,7 @@ Transform: m_GameObject: {fileID: 3400309332038407868} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: -0.000000059604645} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -1129,7 +1129,7 @@ Transform: m_GameObject: {fileID: 4951725383111470759} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalPosition: {x: 0, y: 0, z: -0.000000059604645} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] diff --git a/Assets/Scripts/Extension/DeviceDraggable.cs b/Assets/Scripts/Extension/DeviceDraggable.cs new file mode 100644 index 00000000..1e91f2fe --- /dev/null +++ b/Assets/Scripts/Extension/DeviceDraggable.cs @@ -0,0 +1,24 @@ +using GCSeries.Core.Samples; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; +using UnityEngine.EventSystems; + +public class DeviceDraggable : Draggable +{ + Vector3 pos; + Vector3 rot; + private void Awake() + { + pos = transform.position; + rot = transform.localEulerAngles; + } + + public override void OnEndDrag(PointerEventData eventData) + { + base.OnEndDrag(eventData); + transform.position = pos; + transform.localEulerAngles = rot; + } + +} diff --git a/Assets/Scripts/Extension/DeviceDraggable.cs.meta b/Assets/Scripts/Extension/DeviceDraggable.cs.meta new file mode 100644 index 00000000..74aa391c --- /dev/null +++ b/Assets/Scripts/Extension/DeviceDraggable.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c2b2028d0dec50841b6e5477b275f265 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/Item/DeviceItem.cs b/Assets/Scripts/Item/DeviceItem.cs index 81b8a599..dda21e49 100644 --- a/Assets/Scripts/Item/DeviceItem.cs +++ b/Assets/Scripts/Item/DeviceItem.cs @@ -54,6 +54,8 @@ public class DeviceItem : MonoBehaviour UIRoot.Instance.transform.Find("ZStylus").GetComponent().OnObjectExited.AddListener(OnObjExit); UIRoot.Instance.transform.Find("ZMouse").GetComponent().OnClick.AddListener(OnClick); UIRoot.Instance.transform.Find("ZStylus").GetComponent().OnClick.AddListener(OnClick); + + gameObject.GetOrAddComponent(); #endif } diff --git a/Assets/WebPlatform.meta b/Assets/WebPlatform.meta new file mode 100644 index 00000000..b4ce8b4f --- /dev/null +++ b/Assets/WebPlatform.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8daec37f39bdca34e922be7644ef97c1 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: From b15b1e1fba4654668aec3e385333bf5271ba0b5c Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 31 Mar 2025 10:10:29 +0800 Subject: [PATCH 3/7] =?UTF-8?q?web=E5=B9=B3=E5=8F=B0=E6=8E=A5=E5=8F=A3?= =?UTF-8?q?=E5=AF=B9=E6=8E=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/WebPlatform/LaiYiTe.meta | 8 + Assets/WebPlatform/LaiYiTe/Resrouces.meta | 8 + .../WebPlatform/LaiYiTe/Resrouces/RSA.Private | 10 + .../LaiYiTe/Resrouces/RSA.Private.meta | 7 + Assets/WebPlatform/Plugins.meta | 8 + Assets/WebPlatform/Plugins/WebGL.meta | 8 + .../Plugins/WebGL/GetParameters.jslib | 9 + .../Plugins/WebGL/GetParameters.jslib.meta | 32 +++ Assets/WebPlatform/Scripts.meta | 8 + Assets/WebPlatform/Scripts/WebGLHelper.cs | 189 ++++++++++++++++++ .../WebPlatform/Scripts/WebGLHelper.cs.meta | 11 + 11 files changed, 298 insertions(+) create mode 100644 Assets/WebPlatform/LaiYiTe.meta create mode 100644 Assets/WebPlatform/LaiYiTe/Resrouces.meta create mode 100644 Assets/WebPlatform/LaiYiTe/Resrouces/RSA.Private create mode 100644 Assets/WebPlatform/LaiYiTe/Resrouces/RSA.Private.meta create mode 100644 Assets/WebPlatform/Plugins.meta create mode 100644 Assets/WebPlatform/Plugins/WebGL.meta create mode 100644 Assets/WebPlatform/Plugins/WebGL/GetParameters.jslib create mode 100644 Assets/WebPlatform/Plugins/WebGL/GetParameters.jslib.meta create mode 100644 Assets/WebPlatform/Scripts.meta create mode 100644 Assets/WebPlatform/Scripts/WebGLHelper.cs create mode 100644 Assets/WebPlatform/Scripts/WebGLHelper.cs.meta diff --git a/Assets/WebPlatform/LaiYiTe.meta b/Assets/WebPlatform/LaiYiTe.meta new file mode 100644 index 00000000..46d8f71e --- /dev/null +++ b/Assets/WebPlatform/LaiYiTe.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 8f4e4f808ac25d946affe317d1b81545 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/WebPlatform/LaiYiTe/Resrouces.meta b/Assets/WebPlatform/LaiYiTe/Resrouces.meta new file mode 100644 index 00000000..9d6744c3 --- /dev/null +++ b/Assets/WebPlatform/LaiYiTe/Resrouces.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 5da36794a84f2e24aa0626b1466f6360 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/WebPlatform/LaiYiTe/Resrouces/RSA.Private b/Assets/WebPlatform/LaiYiTe/Resrouces/RSA.Private new file mode 100644 index 00000000..3ead6dd1 --- /dev/null +++ b/Assets/WebPlatform/LaiYiTe/Resrouces/RSA.Private @@ -0,0 +1,10 @@ + + vsWZ0Eu/pLeJblZfeAQ7p+KWQHqiJnp9UNwfHLW8Ev2EI9Kg2aPiB/DGmhPab8yCfuQuZIqJSwcCX1XzVvtIOoeeKy53VHOity0oxADtoY+TZSbJraG0+kEwE+S8HZ8u8xAoVg1xcI1a/wnS2CmZSvoqwpOFKufcosyZZeWTyQXhTipLIudmmA+KFWxRjXzcigE/46fA76MzSoH9WUaIq+d8DPJMQwURZcxmMRwIkSmzz6rss10uSdTGqM7VmewDkqeWugIjS0wzSMBKQYgv1rxbMO38hd58J0mygKtjMRdm38MUaPfm2fYCFhqRBuUXnLZ992NHpUNsXesSzlLlyw== + AQAB +

+JTwTuuxi9suxLj+qVfpWwYQ7VIpG5EubZoZrFeHNynysgTbJuSvuujN7rgpT3uejxBbUMjxaOlikECKpTdGs6gyNaAKce6SA+4xobbWmFUS4uE7RBbIXefq/jof0V/etBW4eXwG2IiB2IKhVbPyq3lVmbZcQr3Matm9oEu+H6E=

+ xHcEu0QIDKgxNYLgsmq7i+P+vLGCTXs+8EVNkBKMoyRpLpP+TPCcKnHRK7+j0Od4tD1yYNk/IGPOojjdwzouSDGpIpHNNHOwUOr/n0DVwTWIs8kTRDDVa8al+ptaD8cfssbfbdgs8QkvloX09YLZpZ5dfeKrBH3ZpEtqtjwyves= + buhEr3GJLZUFMNA5DuUiQHJcawYVQS9tP4lZmwMSWRJmLfbssFWn8gScnL2d8NB+1eW+WDTPQLegOiwRr9URvmZ0wGg/QMXob8h+bGBfLmgGnSNQhfiEPSGUPwk/2PKlMkPeopUrmMCO7kKaKNq4krj38DTkxQJZifLMIBCrKwE= + gSyIDeCTMk8726Uru+N1YGsNyF8l/2+zWCMY9ktb8MA18AwaPdhNtZKUJyGfwfEPaeKk24y7dr5o1DxzgrM0Tv9n53TZ6UzPdsSsQbdNU/Ww5hSk+EbrbCt2YinWs10HOHKN4Rkro2eYxG1bPDlGhSB09Boeu5tLiDyV8y/tZPU= + FZzsXZ8ReLoBF9hYAaxP4/41uvReXoYVi3AcJrTwtC3a3fBKGAfXB+6oMbVtU9iPOWD1C7I0ZZh3A8xhQp730bLvbbdZWrpR4eY2RnefAW9EJESHfdDCxnsAIiH7+V/gAieF7bN0G5uifx/OxQl5pogovrLWLmZ+cw3QnMLX1kY= + trGx7eK881e5S2t4Hg2fu9WpIrLOmp7vaAKF4Q7BwEX8x/mshQEHM6eH6oJczHhD+JU5QJvTg4CA6x/63C/lKfg6pwvmx3++MkITKjHhYLmI5HPS7G9SS98l1cdVx+BsK+YrWs2g97LHlDqqKs0busv9Kz3vZ/mIOHhL52OGthk7SBSL0Nbq5rCCyErQEKPk3HmVmF2nJTam3d1PK0OT7I4IH5Szn9CXt1R3kk1Y2NZb3GIrcPUaQ7+75/DlVL05Leabc/eMi/ghhyCqOotHnLw8uNf3kK6QvD/bv3C4Ikdy1ZYBpENz74OMeINWAEXZyARLgs4EryA+6F7Fw3magQ== +
\ No newline at end of file diff --git a/Assets/WebPlatform/LaiYiTe/Resrouces/RSA.Private.meta b/Assets/WebPlatform/LaiYiTe/Resrouces/RSA.Private.meta new file mode 100644 index 00000000..288425aa --- /dev/null +++ b/Assets/WebPlatform/LaiYiTe/Resrouces/RSA.Private.meta @@ -0,0 +1,7 @@ +fileFormatVersion: 2 +guid: 72fe0ae24cde45946914fa10b54896b0 +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/WebPlatform/Plugins.meta b/Assets/WebPlatform/Plugins.meta new file mode 100644 index 00000000..83ed0eb0 --- /dev/null +++ b/Assets/WebPlatform/Plugins.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 4a5ff23952c587c48ab012049e07df51 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/WebPlatform/Plugins/WebGL.meta b/Assets/WebPlatform/Plugins/WebGL.meta new file mode 100644 index 00000000..3a9a3ea3 --- /dev/null +++ b/Assets/WebPlatform/Plugins/WebGL.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: 23a14a5f29ce27c4dab61a5fe698a2e9 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/WebPlatform/Plugins/WebGL/GetParameters.jslib b/Assets/WebPlatform/Plugins/WebGL/GetParameters.jslib new file mode 100644 index 00000000..a460273f --- /dev/null +++ b/Assets/WebPlatform/Plugins/WebGL/GetParameters.jslib @@ -0,0 +1,9 @@ +// 名为 "URLParameters.jslib" 的插件文件 +mergeInto(LibraryManager.library, { + GetURLParameter: function (name) { + var search = window.location.search.substring(1); + var params = new URLSearchParams(search); + var value = params.get(name); + return value ? Pointer_stringify(value) : null; + } +}); \ No newline at end of file diff --git a/Assets/WebPlatform/Plugins/WebGL/GetParameters.jslib.meta b/Assets/WebPlatform/Plugins/WebGL/GetParameters.jslib.meta new file mode 100644 index 00000000..8e6335ec --- /dev/null +++ b/Assets/WebPlatform/Plugins/WebGL/GetParameters.jslib.meta @@ -0,0 +1,32 @@ +fileFormatVersion: 2 +guid: af1b30451ed743d4f81b3f9c8c15baeb +PluginImporter: + externalObjects: {} + serializedVersion: 2 + iconMap: {} + executionOrder: {} + defineConstraints: [] + isPreloaded: 0 + isOverridable: 0 + isExplicitlyReferenced: 0 + validateReferences: 1 + platformData: + - first: + Any: + second: + enabled: 0 + settings: {} + - first: + Editor: Editor + second: + enabled: 0 + settings: + DefaultValueInitialized: true + - first: + WebGL: WebGL + second: + enabled: 1 + settings: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/WebPlatform/Scripts.meta b/Assets/WebPlatform/Scripts.meta new file mode 100644 index 00000000..978d3f73 --- /dev/null +++ b/Assets/WebPlatform/Scripts.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: b8dbba4c57255fc4495c422b41445cbe +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/WebPlatform/Scripts/WebGLHelper.cs b/Assets/WebPlatform/Scripts/WebGLHelper.cs new file mode 100644 index 00000000..ad0d032f --- /dev/null +++ b/Assets/WebPlatform/Scripts/WebGLHelper.cs @@ -0,0 +1,189 @@ +using Newtonsoft.Json; +using QFramework; +using System; +using System.Collections; +using System.Collections.Generic; +using System.IO; +using System.Runtime.InteropServices; +using System.Security.Cryptography; +using System.Text; +using UnityEngine; +using UnityEngine.Events; +using UnityEngine.Networking; + +public class WebGLHelper : Singleton +{ + private WebGLHelper() { } + public class LabData + { + public string GUID; + public string ExpID; + public string HOST; + public string PARA1; + public string PARA; + public string PARA2; + } + [DllImport("__Internal")] + private static extern string GetURLParameter(string name); + + string token = string.Empty; + + LabData labData = new LabData(); + [SerializeField] + private TextAsset RSA; + private const int RsaKeySize = 2048; + + public string uploadUrl; + + public void Init() + { + token = GetURLParameter("token").Replace("%2B", "+"); + RSA = Resources.Load("RSA"); + string urlData = Decrypt(token); + var datas = urlData.Split("&"); + labData.GUID = datas[0]; + labData.ExpID = datas[1]; + labData.HOST = datas[2]; + labData.PARA1 = datas[3]; + labData.PARA = datas[4]; + labData.PARA2 = datas[5]; + + uploadUrl = Path.Combine(labData.HOST, "host/public/Exp/AddScore/"); + } + /// + /// Decrypts encrypted text given a RSA private key file path.· RSA ˽Կļ + + /// + /// ܵ + /// ڼܵ˽Կ·. + /// δݵַ + public string Decrypt(string encryptedText) + { + using (var rsa = new RSACryptoServiceProvider(RsaKeySize)) + { + try + { + string privateXmlKey = RSA.text; + rsa.FromXmlString(privateXmlKey); + Debug.Log("encryptedText " + encryptedText); + var bytesEncrypted = Convert.FromBase64String(encryptedText); + string b = Encoding.UTF8.GetString(bytesEncrypted); + Debug.Log("byte " + b); + //var bytesPlainText = rsa.Decrypt(bytesEncrypted, false); + var bytesPlainText = rsa.Decrypt(bytesEncrypted, false); + Debug.Log("bytesPlainText " + bytesPlainText); + return System.Text.Encoding.UTF8.GetString(bytesPlainText); + } + finally + { + rsa.PersistKeyInCsp = false; + } + } + } + + + + public void UpLoadData(int totalScore, List stepNames, List maxScore, List score) + { + var data = new UploadData(); + data.GUID = labData.GUID; + data.ExpID = int.Parse(labData.ExpID); + data.score = totalScore; + data.flag = true; + + var list = new List(); + for (int i = 0; i < stepNames.Count; i++) + { + var step = new Expstepvtwolist(); + step.ExpStepName = stepNames[i]; + step.maxScore = maxScore[i]; + step.score = score[i]; + } + data.ExpStepVTwoList = list.ToArray(); + + + } + + IEnumerator SendScore(string json, UnityAction action) + { + if (string.IsNullOrEmpty(uploadUrl)) + { + Debug.LogError("ϴӿڵַ:" + uploadUrl); + yield break; + } + + using (UnityWebRequest request = new UnityWebRequest(uploadUrl, "POST")) + { + request.SetRequestHeader("Content-Type", "application/json"); + request.uploadHandler = new UploadHandlerRaw(System.Text.Encoding.UTF8.GetBytes(json)); + request.downloadHandler = new DownloadHandlerBuffer(); + yield return request.SendWebRequest(); + // Ӧ + if (request.result == UnityWebRequest.Result.ConnectionError || + request.result == UnityWebRequest.Result.ProtocolError) + { + Debug.LogError($"Upload failed: {request.error}"); + Debug.LogError($"Response Code: {request.responseCode}"); + } + else + { + Debug.Log("Upload complete!"); + Debug.Log($"Response Code: {request.responseCode}"); + Debug.Log($"Server Response: {request.downloadHandler.text}"); + Response response = JsonConvert.DeserializeObject(request.downloadHandler.text); + Debug.LogError(response.msg); + } + } + + } +} + + + + +public class UploadData +{ + public string GUID { get; set; } + // ʵ ID + public int ExpID { get; set; } + // ɼ + public int score { get; set; } + // ־λĬֵ true + public bool flag { get; set; } + // ʵ鲽б + public Expstepvtwolist[] ExpStepVTwoList { get; set; } +} + +public class Expstepvtwolist +{ + // ʵ鲽 + public int seq { get; set; } + // ʵ鲽 + public string ExpStepName = ""; + // ʵ鲽״̬ + public string StepState = ""; + // ʵ鲽迪ʼʱ + public DateTime startTime = default; + // ʵ鲽ʱ + public DateTime endTime = default; + // ʵ鲽ʱλ + public int expectTime = 0; + // ʵ鲽֣0 ~100ٷ + public int maxScore = 100; + // ʵ鲽÷֣0 ~100ٷ + public int score = 0; + // ʵ鲽 + public int repeatCount = 1; + // ۣ200 + public string evaluation = ""; + // ģͣ200 + public string scoringModel = ""; + // ע + public string remarks { get; set; } +} + +public class Response +{ + public string msg; + public bool success; +} \ No newline at end of file diff --git a/Assets/WebPlatform/Scripts/WebGLHelper.cs.meta b/Assets/WebPlatform/Scripts/WebGLHelper.cs.meta new file mode 100644 index 00000000..a2f6aa5c --- /dev/null +++ b/Assets/WebPlatform/Scripts/WebGLHelper.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: c1b108973e2a6cd43bf6b1943d979a23 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 5105a9b9ab237db342f484a4c27315117fdaf5d9 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 31 Mar 2025 16:07:26 +0800 Subject: [PATCH 4/7] =?UTF-8?q?=E9=80=82=E9=85=8DVR?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Art/UIPrefab/UITipWindow.prefab | 6 +- .../UIKit/Scripts/Resources/VRUIRoot.prefab | 328 +----------------- .../Scripts/Conditions/ObjClickCondition.cs | 29 +- Assets/Scripts/Item/DeviceItem.cs | 15 +- Assets/Scripts/Item/Point3DItem.cs | 47 +++ Assets/Scripts/UI/UIRightTop.cs | 2 +- Assets/Scripts/VR.meta | 8 + Assets/Scripts/VR/StylusVibration.cs | 111 ++++++ Assets/Scripts/VR/StylusVibration.cs.meta | 11 + 9 files changed, 226 insertions(+), 331 deletions(-) create mode 100644 Assets/Scripts/VR.meta create mode 100644 Assets/Scripts/VR/StylusVibration.cs create mode 100644 Assets/Scripts/VR/StylusVibration.cs.meta diff --git a/Assets/Art/UIPrefab/UITipWindow.prefab b/Assets/Art/UIPrefab/UITipWindow.prefab index ada0c7aa..0aecb229 100644 --- a/Assets/Art/UIPrefab/UITipWindow.prefab +++ b/Assets/Art/UIPrefab/UITipWindow.prefab @@ -136,7 +136,7 @@ MonoBehaviour: m_EditorClassIdentifier: m_Material: {fileID: 0} m_Color: {r: 1, g: 1, b: 1, a: 1} - m_RaycastTarget: 1 + m_RaycastTarget: 0 m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} m_Maskable: 1 m_OnCullStateChanged: @@ -495,7 +495,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: Label CustomComment: mComponentName: TMPro.TextMeshProUGUI --- !u!1 &8134342667276409362 @@ -834,6 +834,6 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: BtnPrefab CustomComment: mComponentName: UnityEngine.UI.Button diff --git a/Assets/QFramework/Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab b/Assets/QFramework/Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab index 7fc3f886..f9dc78d8 100644 --- a/Assets/QFramework/Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab +++ b/Assets/QFramework/Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab @@ -123,8 +123,8 @@ Transform: m_GameObject: {fileID: 598348144801550191} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 2.1975, z: 0} - m_LocalScale: {x: 15, y: 15, z: 15} + m_LocalPosition: {x: 0, y: 0.1465, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 5974269590546671381} @@ -144,7 +144,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: Frame: {fileID: 6717849271440217812} - ViewerScale: 15 + ViewerScale: 1 --- !u!1 &765259898297824089 GameObject: m_ObjectHideFlags: 0 @@ -174,7 +174,7 @@ Transform: serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 15, y: 15, z: 15} + m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - {fileID: 964729101505013327} @@ -192,7 +192,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: b20817e9db276aa4182f6e0885aa2ddf, type: 3} m_Name: m_EditorClassIdentifier: - ViewerScale: 15 + ViewerScale: 1 --- !u!114 &2720570802681005941 MonoBehaviour: m_ObjectHideFlags: 0 @@ -634,7 +634,7 @@ Transform: m_GameObject: {fileID: 3400309332038407868} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.000000059604645} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -1007,7 +1007,6 @@ RectTransform: - {fileID: 4067008720307835646} - {fileID: 5346698416423119099} - {fileID: 6454445510295011543} - - {fileID: 2655199300068705655} m_Father: {fileID: 4955625632054724442} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0.5, y: 0.5} @@ -1129,7 +1128,7 @@ Transform: m_GameObject: {fileID: 4951725383111470759} serializedVersion: 2 m_LocalRotation: {x: -0, y: -0, z: -0, w: 1} - m_LocalPosition: {x: 0, y: 0, z: -0.000000059604645} + m_LocalPosition: {x: 0, y: 0, z: 0} m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: [] @@ -1678,316 +1677,3 @@ MonoBehaviour: OnButtonReleased: m_PersistentCalls: m_Calls: [] ---- !u!1001 &2655199300079889975 -PrefabInstance: - m_ObjectHideFlags: 0 - serializedVersion: 2 - m_Modification: - serializedVersion: 3 - m_TransformParent: {fileID: 7801786202371978394} - m_Modifications: - - target: {fileID: 132536, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_Name - value: Debug - objectReference: {fileID: 0} - - target: {fileID: 11414302, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_Size - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 11414302, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_Value - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 11440770, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_PresetInfoIsWorld - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 22400762, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.y - value: -0.000030517578 - objectReference: {fileID: 0} - - target: {fileID: 22426080, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMax.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22426080, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22426080, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22428984, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22428984, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22428984, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22428984, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22428984, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22428984, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22455554, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22455554, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22455554, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22455554, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22455554, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22455554, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_Pivot.x - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_Pivot.y - value: 0.5 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMax.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMax.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMin.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalScale.x - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalScale.y - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalScale.z - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalPosition.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalRotation.w - value: 1 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalRotation.x - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalRotation.y - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalRotation.z - value: -0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalEulerAnglesHint.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalEulerAnglesHint.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_LocalEulerAnglesHint.z - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22468896, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22468896, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22468896, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22468896, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22468896, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22468896, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22488670, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22488670, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22488670, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22488670, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22488670, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22488670, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22495692, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22495692, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22495692, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22495692, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22495692, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 22495692, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224619367409363176, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224856348943071238, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMax.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224856348943071238, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchorMin.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224856348943071238, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224856348943071238, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_SizeDelta.y - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224856348943071238, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.x - value: 0 - objectReference: {fileID: 0} - - target: {fileID: 224856348943071238, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - propertyPath: m_AnchoredPosition.y - value: 0 - objectReference: {fileID: 0} - m_RemovedComponents: - - {fileID: 11490438, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - - {fileID: 11440770, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - - {fileID: 22331464, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - m_RemovedGameObjects: [] - m_AddedGameObjects: [] - m_AddedComponents: [] - m_SourcePrefab: {fileID: 100100000, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} ---- !u!224 &2655199300068705655 stripped -RectTransform: - m_CorrespondingSourceObject: {fileID: 22457152, guid: 67117722a812a2e46ab8cb8eafbf5f5e, type: 3} - m_PrefabInstance: {fileID: 2655199300079889975} - m_PrefabAsset: {fileID: 0} diff --git a/Assets/Scripts/Conditions/ObjClickCondition.cs b/Assets/Scripts/Conditions/ObjClickCondition.cs index cd0c2e89..9ff00507 100644 --- a/Assets/Scripts/Conditions/ObjClickCondition.cs +++ b/Assets/Scripts/Conditions/ObjClickCondition.cs @@ -19,6 +19,7 @@ namespace QFramework string deviceName; bool isRight; + bool isClick = false; public static ObjClickCondition Allocate(string path, Dictionary datas) { var conditionAction = mSimpleObjectPool.Allocate(); @@ -32,6 +33,7 @@ namespace QFramework { bool.TryParse(datas["isRight"], out conditionAction.isRight); } + conditionAction.isClick = false; return conditionAction; } public bool Check() @@ -73,7 +75,7 @@ namespace QFramework } #endif - return false; + return isClick; } public bool Paused { get; set; } public bool Deinited { get; set; } @@ -89,12 +91,25 @@ namespace QFramework #if VR public void OnClick(ZPointer pointer, int index, GameObject obj) { - if (this.obj != null && obj == this.obj) + if (isRight) { - this.Finish(); - UIRoot.Instance.transform.Find("ZMouse").GetComponent().OnClick.RemoveListener(OnClick); - UIRoot.Instance.transform.Find("ZStylus").GetComponent().OnClick.RemoveListener(OnClick); + if (this.obj != null && obj == this.obj) + { + isClick = true; + } } + else + { + if (this.obj != null) + { + var item = obj.GetComponent(); + if (item != null && obj != this.obj) + { + isClick = true; + } + } + } + } #endif @@ -118,6 +133,10 @@ namespace QFramework obj = null; path = null; mSimpleObjectPool.Recycle(this); +#if VR + UIRoot.Instance.transform.Find("ZMouse").GetComponent().OnClick.RemoveListener(OnClick); + UIRoot.Instance.transform.Find("ZStylus").GetComponent().OnClick.RemoveListener(OnClick); +#endif } } diff --git a/Assets/Scripts/Item/DeviceItem.cs b/Assets/Scripts/Item/DeviceItem.cs index dda21e49..4a352cfd 100644 --- a/Assets/Scripts/Item/DeviceItem.cs +++ b/Assets/Scripts/Item/DeviceItem.cs @@ -24,6 +24,7 @@ public class DeviceItem : MonoBehaviour effect.outlineColor = Utility.ToColor(device.HighColor); StringEventSystem.Global.Register(Global.HighLightTrigger, OnHighLightTriggerEvent); TypeEventSystem.Global.Register(OnStepChanged); + TypeEventSystem.Global.Register(OnModuleQuitEvent); #if VR effect.constantWidth = false; @@ -55,11 +56,14 @@ public class DeviceItem : MonoBehaviour UIRoot.Instance.transform.Find("ZMouse").GetComponent().OnClick.AddListener(OnClick); UIRoot.Instance.transform.Find("ZStylus").GetComponent().OnClick.AddListener(OnClick); - gameObject.GetOrAddComponent(); + //gameObject.GetOrAddComponent(); + gameObject.GetOrAddComponent(); #endif } + + #if VR private void OnClick(ZPointer arg0, int arg1, GameObject arg2) @@ -110,6 +114,14 @@ public class DeviceItem : MonoBehaviour #endif private void OnStepChanged(StepStatusOnChange change) + { + CloseHighLight(); + } + private void OnModuleQuitEvent(OnModuleQuit quit) + { + CloseHighLight(); + } + public void CloseHighLight() { var effect = gameObject.GetComponent(); if (effect != null) @@ -124,6 +136,7 @@ public class DeviceItem : MonoBehaviour tipItem = null; StringEventSystem.Global.UnRegister(Global.HighLightTrigger, OnHighLightTriggerEvent); TypeEventSystem.Global.UnRegister(OnStepChanged); + TypeEventSystem.Global.UnRegister(OnModuleQuitEvent); } private void OnHighLightTriggerEvent(string[] obj) diff --git a/Assets/Scripts/Item/Point3DItem.cs b/Assets/Scripts/Item/Point3DItem.cs index 8acfd894..d0eb9353 100644 --- a/Assets/Scripts/Item/Point3DItem.cs +++ b/Assets/Scripts/Item/Point3DItem.cs @@ -1,3 +1,4 @@ +using GCSeries.Core.Input; using QFramework; using System; using System.Collections; @@ -40,8 +41,54 @@ public class Point3DItem : MonoBehaviour TypeEventSystem.Global.Register(OnObjDestroy); TypeEventSystem.Global.Register(OnStepChanged); + +#if VR + UIRoot.Instance.transform.Find("ZStylus").GetComponent().OnObjectEntered.AddListener(OnObjEnter); + UIRoot.Instance.transform.Find("ZStylus").GetComponent().OnObjectExited.AddListener(OnObjExit); + UIRoot.Instance.transform.Find("ZStylus").GetComponent().OnClick.AddListener(OnClick); +#endif } +#if VR + private void OnClick(ZPointer arg0, int arg1, GameObject arg2) + { + if (gameObject == arg2) + { + if (string.IsNullOrEmpty(data.clickEvent) == false) + { + StringEventSystem.Global.Send(data.clickEvent); + } + TypeEventSystem.Global.Send(); + } + } + + private void OnObjExit(ZPointer arg0, GameObject arg1) + { + if (gameObject == arg1) + { + isEnter = false; + } + + } + + private void OnObjEnter(ZPointer arg0, GameObject arg1) + { + if (gameObject == arg1) + { + isEnter = true; + } + } + + bool isEnter = false; + private void Update() + { + if (isEnter) + { + transform.Rotate(Vector3.forward * Time.deltaTime * rotSpeed); + } + } +#endif + private void OnStepChanged(StepStatusOnChange change) { OnObjDestroy(default); diff --git a/Assets/Scripts/UI/UIRightTop.cs b/Assets/Scripts/UI/UIRightTop.cs index ee4e1807..8e7c279d 100644 --- a/Assets/Scripts/UI/UIRightTop.cs +++ b/Assets/Scripts/UI/UIRightTop.cs @@ -46,7 +46,7 @@ namespace QFramework.Example UITipWindowData data = new UITipWindowData(); data.txt = "Ƿر"; - data.btns.Add(new UITipWindowData.ItemData() { txt = "", OnClick = () => Application.Quit() }); + data.btns.Add(new UITipWindowData.ItemData() { txt = "", OnClick = () => { Application.Quit(); } }); data.btns.Add(new UITipWindowData.ItemData() { txt = "" }); UIKit.OpenPanelAsync(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(); } diff --git a/Assets/Scripts/VR.meta b/Assets/Scripts/VR.meta new file mode 100644 index 00000000..8694c18b --- /dev/null +++ b/Assets/Scripts/VR.meta @@ -0,0 +1,8 @@ +fileFormatVersion: 2 +guid: a7c1e718f16cc7e41a8325205bafa695 +folderAsset: yes +DefaultImporter: + externalObjects: {} + userData: + assetBundleName: + assetBundleVariant: diff --git a/Assets/Scripts/VR/StylusVibration.cs b/Assets/Scripts/VR/StylusVibration.cs new file mode 100644 index 00000000..e890ad59 --- /dev/null +++ b/Assets/Scripts/VR/StylusVibration.cs @@ -0,0 +1,111 @@ +//////////////////////////////////////////////////////////////////////////////// +// +// Copyright (C) 2007-2020 , Inc. All Rights Reserved. +// +//////////////////////////////////////////////////////////////////////////////// + +using UnityEngine; +using UnityEngine.EventSystems; + +using GCSeries.Core.Sdk; +using GCSeries.Core; + +/// +/// 未来立体 笔震动脚本 +/// +public class StylusVibration : MonoBehaviour, + IPointerEnterHandler, IPointerExitHandler +{ + //////////////////////////////////////////////////////////////////////// + // Inspector Fields + //////////////////////////////////////////////////////////////////////// + + public VibrationTypeEnum VibrationType; + public float VibrationIntensity; + + //////////////////////////////////////////////////////////////////////// + // Enumerators + //////////////////////////////////////////////////////////////////////// + + public enum VibrationTypeEnum + { + Constant, + FastPulse, + MediumPulse, + SlowPulse + } + + //////////////////////////////////////////////////////////////////////// + // MonoBehaviour Callbacks + //////////////////////////////////////////////////////////////////////// + + private void Start() + { + if (ZProvider.IsInitialized) + { + this._stylusTarget = ZProvider.StylusTarget; + this._stylusTarget.IsVibrationEnabled = true; + } + else + { + Debug.LogWarning("ZProvider can not initialize.\n Stylus" + + "vibration and LED light feedback will not be experienced."); + + Destroy(this); + } + } + + //////////////////////////////////////////////////////////////////////// + // Public Methods + //////////////////////////////////////////////////////////////////////// + + public void OnPointerEnter(PointerEventData eventData) + { + this.Vibrate(); + } + + public void OnPointerExit(PointerEventData eventData) + { + this._stylusTarget.StopVibration(); + } + + //////////////////////////////////////////////////////////////////////// + // Private Methods + //////////////////////////////////////////////////////////////////////// + + private void Vibrate() + { + switch (this.VibrationType) + { + case VibrationTypeEnum.Constant: + this._stylusTarget.StartVibration( + 1.0f, 0.0f, 100, this.VibrationIntensity); + break; + + case VibrationTypeEnum.FastPulse: + this._stylusTarget.StartVibration( + 0.1f, 0.1f, 100, this.VibrationIntensity); + break; + + case VibrationTypeEnum.MediumPulse: + this._stylusTarget.StartVibration( + 0.3f, 0.3f, 100, this.VibrationIntensity); + break; + + case VibrationTypeEnum.SlowPulse: + this._stylusTarget.StartVibration( + 0.6f, 0.6f, 100, this.VibrationIntensity); + break; + + default: + break; + } + } + + //////////////////////////////////////////////////////////////////////// + // Private Members + //////////////////////////////////////////////////////////////////////// + + private ZTarget _stylusTarget; +} + diff --git a/Assets/Scripts/VR/StylusVibration.cs.meta b/Assets/Scripts/VR/StylusVibration.cs.meta new file mode 100644 index 00000000..30e7f2d5 --- /dev/null +++ b/Assets/Scripts/VR/StylusVibration.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 096518624f225c648a0cf58d85666b9c +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: From 4b38a930f6d941afd29e6786d26fc2b5de063e56 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 31 Mar 2025 16:47:41 +0800 Subject: [PATCH 5/7] =?UTF-8?q?=E4=BF=AE=E5=A4=8Dvr=E9=80=82=E9=85=8Dbug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab | 2 +- Assets/Scripts/Item/DeviceItem.cs | 2 +- Assets/Scripts/UI/UIRightTop.cs | 3 ++- 3 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Assets/QFramework/Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab b/Assets/QFramework/Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab index f9dc78d8..605d1e38 100644 --- a/Assets/QFramework/Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab +++ b/Assets/QFramework/Toolkits/UIKit/Scripts/Resources/VRUIRoot.prefab @@ -1032,7 +1032,7 @@ Canvas: m_OverridePixelPerfect: 0 m_SortingBucketNormalizedSize: 0 m_VertexColorAlwaysGammaSpace: 0 - m_AdditionalShaderChannelsFlag: 0 + m_AdditionalShaderChannelsFlag: 25 m_UpdateRectTransformForStandalone: 0 m_SortingLayerID: 0 m_SortingOrder: 0 diff --git a/Assets/Scripts/Item/DeviceItem.cs b/Assets/Scripts/Item/DeviceItem.cs index 4a352cfd..7957277a 100644 --- a/Assets/Scripts/Item/DeviceItem.cs +++ b/Assets/Scripts/Item/DeviceItem.cs @@ -16,6 +16,7 @@ public class DeviceItem : MonoBehaviour public void Init(XMLTool.Device device) { this.device = device; + TypeEventSystem.Global.Register(OnModuleQuitEvent); if (string.IsNullOrEmpty(device.HighColor) == false) { var effect = gameObject.GetOrAddComponent(); @@ -24,7 +25,6 @@ public class DeviceItem : MonoBehaviour effect.outlineColor = Utility.ToColor(device.HighColor); StringEventSystem.Global.Register(Global.HighLightTrigger, OnHighLightTriggerEvent); TypeEventSystem.Global.Register(OnStepChanged); - TypeEventSystem.Global.Register(OnModuleQuitEvent); #if VR effect.constantWidth = false; diff --git a/Assets/Scripts/UI/UIRightTop.cs b/Assets/Scripts/UI/UIRightTop.cs index 8e7c279d..8d9bee27 100644 --- a/Assets/Scripts/UI/UIRightTop.cs +++ b/Assets/Scripts/UI/UIRightTop.cs @@ -2,6 +2,7 @@ using UnityEngine; using UnityEngine.UI; using QFramework; using System.Data.Common; +using UnityEngine.SceneManagement; namespace QFramework.Example { @@ -93,7 +94,7 @@ namespace QFramework.Example txt = "", OnClick = () => { - Hide(); + Hide(); TypeEventSystem.Global.Send(); UIKit.OpenPanelAsync().ToAction().StartGlobal(); } From 2d53a3e8e7fb72c97159214365e464c2379c7b0a Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 31 Mar 2025 16:48:55 +0800 Subject: [PATCH 6/7] =?UTF-8?q?=E5=90=88=E5=B9=B6=E5=9C=BA=E6=99=AF?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scenes/Main.unity | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 1e2b2d9a..57f67364 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -26,7 +26,7 @@ RenderSettings: m_AmbientIntensity: 1 m_AmbientMode: 0 m_SubtractiveShadowColor: {r: 0.13296545, g: 0.19145328, b: 0.33962262, a: 1} - m_SkyboxMaterial: {fileID: 2100000, guid: 0ffaa0b7117ba8c47a9d05ae701d4b4d, type: 2} + m_SkyboxMaterial: {fileID: 0} m_HaloStrength: 0.5 m_FlareStrength: 1 m_FlareFadeSpeed: 3 @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.5649007, g: 0.6356403, b: 0.72393775, a: 1} + m_IndirectSpecularColor: {r: 0.37933365, g: 0.4104958, b: 0.42596278, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: From bb39ba82b588e8d2094c5d3412bc9e14dfb754f5 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Mon, 31 Mar 2025 16:49:32 +0800 Subject: [PATCH 7/7] =?UTF-8?q?=E9=BB=98=E8=AE=A4=E5=9C=BA=E6=99=AF?= =?UTF-8?q?=E6=97=A0=E9=A2=9C=E8=89=B2?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Scenes/Main.unity | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index 57f67364..4e3c1859 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -25,7 +25,7 @@ RenderSettings: m_AmbientGroundColor: {r: 0.047, g: 0.043, b: 0.035, a: 1} m_AmbientIntensity: 1 m_AmbientMode: 0 - m_SubtractiveShadowColor: {r: 0.13296545, g: 0.19145328, b: 0.33962262, a: 1} + m_SubtractiveShadowColor: {r: 1, g: 1, b: 1, a: 1} m_SkyboxMaterial: {fileID: 0} m_HaloStrength: 0.5 m_FlareStrength: 1 @@ -38,7 +38,7 @@ RenderSettings: m_ReflectionIntensity: 1 m_CustomReflection: {fileID: 0} m_Sun: {fileID: 0} - m_IndirectSpecularColor: {r: 0.37933365, g: 0.4104958, b: 0.42596278, a: 1} + m_IndirectSpecularColor: {r: 0, g: 0, b: 0, a: 1} m_UseRadianceAmbientProbe: 0 --- !u!157 &3 LightmapSettings: