From e3bc40bf8b7651a6bcf82da838ae18f80211e4c9 Mon Sep 17 00:00:00 2001 From: shenjianxing <”315615051@qq.com“> Date: Thu, 13 Feb 2025 17:21:18 +0800 Subject: [PATCH] =?UTF-8?q?=E5=AE=8C=E5=96=843D=E8=A7=A3=E5=89=96=E5=8A=9F?= =?UTF-8?q?=E8=83=BD=20=E5=A2=9E=E5=8A=A0TextTip=E6=A0=87=E9=A2=98?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Assets/Art/UIPrefab/UIBody3D.prefab | 686 +++++++++++++++++- ...I3DBodyInfo.prefab => UIBody3DInfo.prefab} | 2 +- ...o.prefab.meta => UIBody3DInfo.prefab.meta} | 0 Assets/Art/UIPrefab/UITextTip.prefab | 159 +++- Assets/Scenes/Main.unity | 3 +- ...DBodyInfo.unity => TestUIBody3DInfo.unity} | 0 ...unity.meta => TestUIBody3DInfo.unity.meta} | 0 Assets/Scripts/Actions/ActionHelper.cs | 4 +- Assets/Scripts/Actions/TextTipAction.cs | 13 +- Assets/Scripts/Controller/Body3DController.cs | 76 +- Assets/Scripts/Controller/ScoreController.cs | 13 +- Assets/Scripts/Item/ObjDrag.cs | 48 +- Assets/Scripts/Item/ObjectToggle.cs | 7 +- Assets/Scripts/Item/Show3DCamera.cs | 17 +- Assets/Scripts/UI/UIBody3D.Designer.cs | 8 +- Assets/Scripts/UI/UIBody3D.cs | 27 +- ...o.Designer.cs => UIBody3DInfo.Designer.cs} | 10 +- ....cs.meta => UIBody3DInfo.Designer.cs.meta} | 0 .../UI/{UI3DBodyInfo.cs => UIBody3DInfo.cs} | 6 +- ...DBodyInfo.cs.meta => UIBody3DInfo.cs.meta} | 0 Assets/Scripts/UI/UIModuleSelect.cs | 25 +- Assets/Scripts/UI/UITextTip.Designer.cs | 5 +- Assets/Scripts/UI/UITextTip.cs | 19 +- Assets/Scripts/Xml/XmlParser.cs | 15 +- Doc/Xml配置文档.xml | 2 +- 25 files changed, 1052 insertions(+), 93 deletions(-) rename Assets/Art/UIPrefab/{UI3DBodyInfo.prefab => UIBody3DInfo.prefab} (99%) rename Assets/Art/UIPrefab/{UI3DBodyInfo.prefab.meta => UIBody3DInfo.prefab.meta} (100%) rename Assets/Scenes/TestUIPanels/{TestUI3DBodyInfo.unity => TestUIBody3DInfo.unity} (100%) rename Assets/Scenes/TestUIPanels/{TestUI3DBodyInfo.unity.meta => TestUIBody3DInfo.unity.meta} (100%) rename Assets/Scripts/UI/{UI3DBodyInfo.Designer.cs => UIBody3DInfo.Designer.cs} (83%) rename Assets/Scripts/UI/{UI3DBodyInfo.Designer.cs.meta => UIBody3DInfo.Designer.cs.meta} (100%) rename Assets/Scripts/UI/{UI3DBodyInfo.cs => UIBody3DInfo.cs} (95%) rename Assets/Scripts/UI/{UI3DBodyInfo.cs.meta => UIBody3DInfo.cs.meta} (100%) diff --git a/Assets/Art/UIPrefab/UIBody3D.prefab b/Assets/Art/UIPrefab/UIBody3D.prefab index 4fe1e180..3860746f 100644 --- a/Assets/Art/UIPrefab/UIBody3D.prefab +++ b/Assets/Art/UIPrefab/UIBody3D.prefab @@ -255,6 +255,144 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &1552595721778161119 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 717044875136205173} + - component: {fileID: 337693509821327650} + - component: {fileID: 3287580684998733913} + - component: {fileID: 778419354692156357} + - component: {fileID: 3554365675561402507} + m_Layer: 5 + m_Name: ActiveBack + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &717044875136205173 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1552595721778161119} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 1900737864650650971} + m_Father: {fileID: 2150121155661727416} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 0, y: 1} + m_AnchoredPosition: {x: 56.1, y: 0} + m_SizeDelta: {x: 102, y: 34} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &337693509821327650 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1552595721778161119} + m_CullTransparentMesh: 1 +--- !u!114 &3287580684998733913 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1552595721778161119} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 8c77a2052664d0d4e9be892444deddd1, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &778419354692156357 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1552595721778161119} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: BtnPrefab + CustomComment: + mComponentName: UnityEngine.UI.Button +--- !u!114 &3554365675561402507 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1552595721778161119} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 4e29b1a8efbd4b44bb3f3716e73f07ff, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 3287580684998733913} + m_OnClick: + m_PersistentCalls: + m_Calls: [] --- !u!1 &1717582815541303580 GameObject: m_ObjectHideFlags: 0 @@ -288,7 +426,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 8286140371639898903} - - {fileID: 4371217188189964319} + - {fileID: 4277527408350916377} m_Father: {fileID: 3644811849542302248} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} @@ -750,6 +888,69 @@ MonoBehaviour: CustomComponentName: BodyContent CustomComment: mComponentName: RectTransform +--- !u!1 &3374657125894741702 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4277527408350916377} + - component: {fileID: 4365302675092903581} + m_Layer: 5 + m_Name: SubBtns + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &4277527408350916377 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3374657125894741702} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 4371217188189964319} + m_Father: {fileID: 7134505307210740835} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 158.1, y: -16.5} + m_SizeDelta: {x: 112.2, y: 67} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &4365302675092903581 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3374657125894741702} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 1 + m_Spacing: 0 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 --- !u!1 &4155433307319882472 GameObject: m_ObjectHideFlags: 0 @@ -881,7 +1082,206 @@ MonoBehaviour: LeftContent: {fileID: 3644811849542302248} DragBtn: {fileID: 4284720363514511568} DragBack: {fileID: 540967449707403434} + ActiveBtn: {fileID: 6692543268377793545} + ActiveBack: {fileID: 3554365675561402507} BodyItem: {fileID: 1682419669064365991} +--- !u!1 &5049956726037078213 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3149154824631645571} + - component: {fileID: 2773094088659386531} + - component: {fileID: 1776019555825648282} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3149154824631645571 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5049956726037078213} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 165414428222451636} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2773094088659386531 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5049956726037078213} + m_CullTransparentMesh: 1 +--- !u!114 &1776019555825648282 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5049956726037078213} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u901F\u9690" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, 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 &5424837477357509673 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2150121155661727416} + - component: {fileID: 660724380524038662} + m_Layer: 5 + m_Name: SubBtns + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 0 +--- !u!224 &2150121155661727416 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5424837477357509673} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 717044875136205173} + m_Father: {fileID: 165414428222451636} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0.5} + m_AnchorMax: {x: 0, y: 0.5} + m_AnchoredPosition: {x: 158.1, y: -16.5} + m_SizeDelta: {x: 112.2, y: 67} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &660724380524038662 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 5424837477357509673} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 1 + m_Spacing: 0 + m_ChildForceExpandWidth: 0 + m_ChildForceExpandHeight: 0 + m_ChildControlWidth: 0 + m_ChildControlHeight: 0 + m_ChildScaleWidth: 0 + m_ChildScaleHeight: 0 + m_ReverseArrangement: 0 --- !u!1 &6081794716422948279 GameObject: m_ObjectHideFlags: 0 @@ -1016,6 +1416,149 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &6579582680906227604 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 165414428222451636} + - component: {fileID: 7781704004794031748} + - component: {fileID: 8625378328012599150} + - component: {fileID: 4952609964016307496} + - component: {fileID: 6692543268377793545} + m_Layer: 5 + m_Name: ActiveBtn + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &165414428222451636 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6579582680906227604} + 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_ConstrainProportionsScale: 0 + m_Children: + - {fileID: 3149154824631645571} + - {fileID: 2150121155661727416} + m_Father: {fileID: 3644811849542302248} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 0, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 102, y: 34} + m_Pivot: {x: 0.5, y: 1} +--- !u!222 &7781704004794031748 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6579582680906227604} + m_CullTransparentMesh: 1 +--- !u!114 &8625378328012599150 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6579582680906227604} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: fe87c0e1cc204ed48ad3b37840f39efc, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_Sprite: {fileID: 21300000, guid: 8c77a2052664d0d4e9be892444deddd1, type: 3} + m_Type: 0 + m_PreserveAspect: 0 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &4952609964016307496 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6579582680906227604} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: BtnPrefab + CustomComment: + mComponentName: UnityEngine.UI.Toggle +--- !u!114 &6692543268377793545 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6579582680906227604} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 9085046f02f69544eb97fd06b6048fe2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Navigation: + m_Mode: 3 + m_WrapAround: 0 + m_SelectOnUp: {fileID: 0} + m_SelectOnDown: {fileID: 0} + m_SelectOnLeft: {fileID: 0} + m_SelectOnRight: {fileID: 0} + m_Transition: 1 + m_Colors: + m_NormalColor: {r: 1, g: 1, b: 1, a: 1} + m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_PressedColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 1} + m_SelectedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} + m_DisabledColor: {r: 0.78431374, g: 0.78431374, b: 0.78431374, a: 0.5019608} + m_ColorMultiplier: 1 + m_FadeDuration: 0.1 + m_SpriteState: + m_HighlightedSprite: {fileID: 0} + m_PressedSprite: {fileID: 0} + m_SelectedSprite: {fileID: 0} + m_DisabledSprite: {fileID: 0} + m_AnimationTriggers: + m_NormalTrigger: Normal + m_HighlightedTrigger: Highlighted + m_PressedTrigger: Pressed + m_SelectedTrigger: Selected + m_DisabledTrigger: Disabled + m_Interactable: 1 + m_TargetGraphic: {fileID: 8625378328012599150} + toggleTransition: 1 + graphic: {fileID: 0} + m_Group: {fileID: 0} + onValueChanged: + m_PersistentCalls: + m_Calls: [] + m_IsOn: 0 --- !u!1 &6581193976255814611 GameObject: m_ObjectHideFlags: 0 @@ -1047,6 +1590,7 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 7134505307210740835} + - {fileID: 165414428222451636} m_Father: {fileID: 1062102287437619772} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0.5} @@ -1096,6 +1640,140 @@ MonoBehaviour: CustomComponentName: BodyContent CustomComment: mComponentName: RectTransform +--- !u!1 &7171058547146952871 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 1900737864650650971} + - component: {fileID: 3989764932603018357} + - component: {fileID: 6149747433283151208} + m_Layer: 5 + m_Name: Label + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &1900737864650650971 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7171058547146952871} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 717044875136205173} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 0} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3989764932603018357 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7171058547146952871} + m_CullTransparentMesh: 1 +--- !u!114 &6149747433283151208 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 7171058547146952871} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u8FD4\u56DE" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, 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 &7452435723576309381 GameObject: m_ObjectHideFlags: 0 @@ -1325,7 +2003,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &4371217188189964319 RectTransform: m_ObjectHideFlags: 0 @@ -1339,11 +2017,11 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 5515100320481424769} - m_Father: {fileID: 7134505307210740835} + m_Father: {fileID: 4277527408350916377} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 163.2, y: 0} + m_AnchoredPosition: {x: 56.1, y: 0} m_SizeDelta: {x: 102, y: 34} m_Pivot: {x: 0.5, y: 1} --- !u!222 &3785937962185117584 diff --git a/Assets/Art/UIPrefab/UI3DBodyInfo.prefab b/Assets/Art/UIPrefab/UIBody3DInfo.prefab similarity index 99% rename from Assets/Art/UIPrefab/UI3DBodyInfo.prefab rename to Assets/Art/UIPrefab/UIBody3DInfo.prefab index e1f9793b..1a126814 100644 --- a/Assets/Art/UIPrefab/UI3DBodyInfo.prefab +++ b/Assets/Art/UIPrefab/UIBody3DInfo.prefab @@ -729,7 +729,7 @@ GameObject: - component: {fileID: 6190215392520032477} - component: {fileID: -1321096431916288768} m_Layer: 0 - m_Name: UI3DBodyInfo + m_Name: UIBody3DInfo m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 diff --git a/Assets/Art/UIPrefab/UI3DBodyInfo.prefab.meta b/Assets/Art/UIPrefab/UIBody3DInfo.prefab.meta similarity index 100% rename from Assets/Art/UIPrefab/UI3DBodyInfo.prefab.meta rename to Assets/Art/UIPrefab/UIBody3DInfo.prefab.meta diff --git a/Assets/Art/UIPrefab/UITextTip.prefab b/Assets/Art/UIPrefab/UITextTip.prefab index 1e66446d..3d8f00a0 100644 --- a/Assets/Art/UIPrefab/UITextTip.prefab +++ b/Assets/Art/UIPrefab/UITextTip.prefab @@ -224,6 +224,157 @@ MonoBehaviour: m_hasFontAssetChanged: 0 m_baseMaterial: {fileID: 0} m_maskOffset: {x: 0, y: 0, z: 0, w: 0} +--- !u!1 &1375299334909793470 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 4002782857371670254} + - component: {fileID: 3875271533057727503} + - component: {fileID: 3613689092755446169} + - component: {fileID: 7384942873950341134} + m_Layer: 5 + m_Name: Title + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &4002782857371670254 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1375299334909793470} + 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_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 530869619305514304} + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: 0, y: -25.498718} + m_SizeDelta: {x: 0, y: 50.9974} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &3875271533057727503 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1375299334909793470} + m_CullTransparentMesh: 1 +--- !u!114 &3613689092755446169 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1375299334909793470} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f4688fdb7df04437aeb418b961361dc5, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Material: {fileID: 0} + m_Color: {r: 1, g: 1, b: 1, a: 1} + m_RaycastTarget: 1 + m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0} + m_Maskable: 1 + m_OnCullStateChanged: + m_PersistentCalls: + m_Calls: [] + m_text: "\u8FD9\u91CC\u662F\u6807\u9898" + m_isRightToLeft: 0 + m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} + m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, 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: 24 + m_fontSizeBase: 24 + 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!114 &7384942873950341134 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 1375299334909793470} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3} + m_Name: + m_EditorClassIdentifier: + MarkType: 0 + CustomComponentName: ContentText + CustomComment: + mComponentName: TMPro.TextMeshProUGUI --- !u!1 &1597918456588028124 GameObject: m_ObjectHideFlags: 0 @@ -309,6 +460,7 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: 5ed9b43aa6da2fd49af65b4ab0b85fc2, type: 3} m_Name: m_EditorClassIdentifier: + Title: {fileID: 3613689092755446169} Des: {fileID: 5150898215778594440} BtnContent: {fileID: 8598386973860236803} Btn: {fileID: 1491398146821546139} @@ -378,7 +530,7 @@ MonoBehaviour: m_OnCullStateChanged: m_PersistentCalls: m_Calls: [] - m_text: + m_text: "\u8FD9\u91CC\u662F\u6807\u9898" m_isRightToLeft: 0 m_fontAsset: {fileID: 11400000, guid: 97936a7b3a86809479ac89371e95b079, type: 2} m_sharedMaterial: {fileID: 168401102475399263, guid: 97936a7b3a86809479ac89371e95b079, type: 2} @@ -616,7 +768,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: MarkType: 0 - CustomComponentName: + CustomComponentName: BtnContent CustomComment: mComponentName: RectTransform --- !u!1 &4469038750498708236 @@ -775,7 +927,7 @@ GameObject: - component: {fileID: 1752210379890057875} - component: {fileID: 7352347895138269808} m_Layer: 5 - m_Name: Connt + m_Name: Content m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -793,6 +945,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: + - {fileID: 4002782857371670254} - {fileID: 503948904615403453} - {fileID: 8598386973860236803} m_Father: {fileID: 7621766697555444520} diff --git a/Assets/Scenes/Main.unity b/Assets/Scenes/Main.unity index f97d201d..8c589f07 100644 --- a/Assets/Scenes/Main.unity +++ b/Assets/Scenes/Main.unity @@ -749,7 +749,7 @@ GameObject: - component: {fileID: 2114935607} m_Layer: 0 m_Name: 3DShowCamera - m_TagString: Untagged + m_TagString: MainCamera m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 @@ -883,6 +883,7 @@ MonoBehaviour: distanceMin: 0.2 distanceMax: 20 pitchMinMax: {x: -20, y: 80} + texture: {fileID: 8400000, guid: 187fba8368491cb428c8cbd324fa9bb4, type: 2} --- !u!222 &102363872365703344 CanvasRenderer: m_ObjectHideFlags: 0 diff --git a/Assets/Scenes/TestUIPanels/TestUI3DBodyInfo.unity b/Assets/Scenes/TestUIPanels/TestUIBody3DInfo.unity similarity index 100% rename from Assets/Scenes/TestUIPanels/TestUI3DBodyInfo.unity rename to Assets/Scenes/TestUIPanels/TestUIBody3DInfo.unity diff --git a/Assets/Scenes/TestUIPanels/TestUI3DBodyInfo.unity.meta b/Assets/Scenes/TestUIPanels/TestUIBody3DInfo.unity.meta similarity index 100% rename from Assets/Scenes/TestUIPanels/TestUI3DBodyInfo.unity.meta rename to Assets/Scenes/TestUIPanels/TestUIBody3DInfo.unity.meta diff --git a/Assets/Scripts/Actions/ActionHelper.cs b/Assets/Scripts/Actions/ActionHelper.cs index 1e8870c8..2123075d 100644 --- a/Assets/Scripts/Actions/ActionHelper.cs +++ b/Assets/Scripts/Actions/ActionHelper.cs @@ -147,8 +147,8 @@ public class ActionHelper } case "TextTip": { - var strAction = (XMLTool.StringListAction)act; - return TextTipAction.Allocate(act.Value, strAction.args[0], strAction.args[1]); + var strAction = (XMLTool.DictionaryAction)act; + return TextTipAction.Allocate(act.Value, strAction.args); } case "UIShow": { diff --git a/Assets/Scripts/Actions/TextTipAction.cs b/Assets/Scripts/Actions/TextTipAction.cs index 4023493d..4fb06b14 100644 --- a/Assets/Scripts/Actions/TextTipAction.cs +++ b/Assets/Scripts/Actions/TextTipAction.cs @@ -15,17 +15,15 @@ public class TextTipAction : IAction private static readonly SimpleObjectPool mPool = new SimpleObjectPool(() => new TextTipAction(), null, 10); string text = string.Empty; - string btns = string.Empty; - string audio = string.Empty; - public static TextTipAction Allocate(string text,string audio , string btns, System.Action onDelayFinish = null) + Dictionary datas; + public static TextTipAction Allocate(string text, Dictionary datas, System.Action onDelayFinish = null) { var retNode = mPool.Allocate(); retNode.ActionID = ActionKit.ID_GENERATOR++; retNode.Deinited = false; retNode.Reset(); retNode.text = text; - retNode.btns = btns; - retNode.audio = audio; + retNode.datas = datas; return retNode; } @@ -52,8 +50,9 @@ public class TextTipAction : IAction { UITextTipData data = new UITextTipData(); data.text = text; - data.btns = btns.Split(',').ToList(); - data.audio = audio; + data.audio = datas.ContainsKey("audio") ? datas["audio"] : string.Empty; + data.title = datas.ContainsKey("title") ? datas["title"] : string.Empty; + data.btns = datas.ContainsKey("btns") ? datas["btns"].Split(',').ToList() : null; UIKit.OpenPanelAsync(uiData: data, canvasLevel: UILevel.PopUI).ToAction().StartGlobal(() => this.Finish()); } diff --git a/Assets/Scripts/Controller/Body3DController.cs b/Assets/Scripts/Controller/Body3DController.cs index c51b2671..db550de3 100644 --- a/Assets/Scripts/Controller/Body3DController.cs +++ b/Assets/Scripts/Controller/Body3DController.cs @@ -7,11 +7,16 @@ using System.Drawing; using UnityEngine; using UnityEngine.EventSystems; using XMLTool; -using static UnityEditor.Progress; using static XMLTool.Body3D; public class Body3DController : MonoSingleton { + public enum Status + { + Normal = 1 << 0, + Active = 1 << 1, + Move = 1 << 2, + } Body3DController() { } @@ -21,6 +26,9 @@ public class Body3DController : MonoSingleton public List isOnList = new List(); public bool allowDrag = false; + + public Status status = Status.Normal; + private Vector2 mouseDownPosition; // ¼갴ʱλ public override void OnSingletonInit() { base.OnSingletonInit(); @@ -48,9 +56,9 @@ public class Body3DController : MonoSingleton } isOnList.Add(selected.obj); - UI3DBodyInfoData data = new UI3DBodyInfoData(); + UIBody3DInfoData data = new UIBody3DInfoData(); data.body = selected.obj.GetComponent().body; - UIKit.OpenPanelAsync(UILevel.PopUI, data).ToAction().Start(this); + UIKit.OpenPanelAsync(UILevel.PopUI, data).ToAction().Start(this); } } else @@ -62,11 +70,25 @@ public class Body3DController : MonoSingleton } if (isOnList.Count <= 0) { - UIKit.HidePanel(); + UIKit.HidePanel(); } } } + public void SetStatus(Status status, bool isAdd) + { + if (isAdd) + { + this.status |= status; + } + else + { + this.status &= status; + } + } + + + public void Active(bool isActive) { foreach (var item in objs) @@ -152,28 +174,52 @@ public class Body3DController : MonoSingleton + + + private void Update() { - if (Input.GetMouseButtonDown(0) && EventSystem.current.IsPointerOverGameObject() == false) + if (Input.GetMouseButtonDown(0)) { - // һߵǰλ - Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); - RaycastHit hit; - if (Physics.Raycast(ray, out hit)) - { - GameObject obj = hit.collider.gameObject; + // ¼갴ʱλ + mouseDownPosition = Input.mousePosition; + } - } - else + if (Input.GetMouseButtonUp(0)) + { + // ȡ̧ʱλ + Vector2 mouseUpPosition = Input.mousePosition; + + // 갴º̧λ֮ľ + float distance = Vector2.Distance(mouseDownPosition, mouseUpPosition); + + // жƶǷС 1 δ UI + if (distance < 1f && EventSystem.current.IsPointerOverGameObject() == false) { - if (selectIsGroup == false) + // һߵǰλ + if (Camera.main != null) { - ClearObjectToggle(); + Ray ray = Camera.main.ScreenPointToRay(Input.mousePosition); + RaycastHit hit; + if (Physics.Raycast(ray, out hit)) + { + //GameObject obj = hit.collider.gameObject; + // Ӵ߻߼ + } + else + { + if (!selectIsGroup) + { + ClearObjectToggle(); + } + } } } } } + + public void ClearObjectToggle() { for (int i = isOnList.Count - (1); i >= 0; i--) diff --git a/Assets/Scripts/Controller/ScoreController.cs b/Assets/Scripts/Controller/ScoreController.cs index 72bdebb0..b80eb017 100644 --- a/Assets/Scripts/Controller/ScoreController.cs +++ b/Assets/Scripts/Controller/ScoreController.cs @@ -21,16 +21,15 @@ public class ScoreController : MonoSingleton public void Init() { - if (Global.Instance.curModule.score != null) - { - if (Global.Instance.curModule.type == "Exam" || Global.Instance.curModule.type == "All") - { - TypeEventSystem.Global.Register(OnStart); - TypeEventSystem.Global.Register(OnQuit); - } + if (Global.Instance.curModule.type == "Exam" || Global.Instance.curModule.type == "All") + { + + TypeEventSystem.Global.Register(OnStart); + TypeEventSystem.Global.Register(OnQuit); } + } public void InitData() diff --git a/Assets/Scripts/Item/ObjDrag.cs b/Assets/Scripts/Item/ObjDrag.cs index a9e40136..5e0500d5 100644 --- a/Assets/Scripts/Item/ObjDrag.cs +++ b/Assets/Scripts/Item/ObjDrag.cs @@ -1,25 +1,50 @@ +using DG.Tweening; +using QFramework; using UnityEngine; public class ObjDrag : MonoBehaviour { private Vector3 offset; - private Camera mainCamera; public bool isOn = false; + Vector3 startPosition; + + // ¼һ갴µʱ + private float lastClickTime; + // ˫ʱֵ + private const float doubleClickTimeThreshold = 0.3f; + void Start() { - // ȡ - mainCamera = Camera.main; + startPosition = gameObject.transform.position; + } + + private void OnMouseUp() + { + if (isOn) + { + Show3DCamera.instance.lockMove = false; + } } void OnMouseDown() { if (isOn) { + // 㵱ǰʱһεʱļ + float currentTime = Time.time; + if (currentTime - lastClickTime < doubleClickTimeThreshold) + { + // ˫¼ + OnDoubleClick(); + } + lastClickTime = currentTime; + // ȡӽƽϵ Vector3 mouseWorldPos = GetMouseWorldPositionOnPlane(); // λеƫ offset = transform.position - mouseWorldPos; + Show3DCamera.instance.lockMove = true; } } @@ -38,19 +63,19 @@ public class ObjDrag : MonoBehaviour { // ȡĻϵλ Vector3 mouseScreenPos = Input.mousePosition; - mouseScreenPos.z = mainCamera.WorldToScreenPoint(transform.position).z; // һ + mouseScreenPos.z = Camera.main.WorldToScreenPoint(transform.position).z; // һ // ĻתΪ - Vector3 mouseWorldPos = mainCamera.ScreenToWorldPoint(mouseScreenPos); + Vector3 mouseWorldPos = Camera.main.ScreenToWorldPoint(mouseScreenPos); // ӽƽķ߷ǰ - Vector3 cameraForward = mainCamera.transform.forward; + Vector3 cameraForward = Camera.main.transform.forward; // һƽ棬߷Ϊǰƽͨĵǰλ Plane plane = new Plane(cameraForward, transform.position); // һߣָ - Ray ray = mainCamera.ScreenPointToRay(mouseScreenPos); + Ray ray = Camera.main.ScreenPointToRay(mouseScreenPos); float distance; if (plane.Raycast(ray, out distance)) @@ -62,4 +87,13 @@ public class ObjDrag : MonoBehaviour // ûཻĵǰλ return transform.position; } + + // ˫¼ + private void OnDoubleClick() + { + // Ҫִе˫߼ + // 磬õʼλ + //transform.position = startPosition; + transform.DOMove(startPosition, 0.3f); + } } \ No newline at end of file diff --git a/Assets/Scripts/Item/ObjectToggle.cs b/Assets/Scripts/Item/ObjectToggle.cs index cbb375e0..856b5e8e 100644 --- a/Assets/Scripts/Item/ObjectToggle.cs +++ b/Assets/Scripts/Item/ObjectToggle.cs @@ -28,8 +28,11 @@ public class ObjectToggle : MonoBehaviour // ʱǷ 0.2 if (clickDuration < 0.2f) { - isOn = !isOn; - OnValueChanged?.Invoke(isOn); + if (isOn == false) + { + isOn = !isOn; + OnValueChanged?.Invoke(isOn); + } } isMouseDown = false; diff --git a/Assets/Scripts/Item/Show3DCamera.cs b/Assets/Scripts/Item/Show3DCamera.cs index a88bd901..1bffbf8a 100644 --- a/Assets/Scripts/Item/Show3DCamera.cs +++ b/Assets/Scripts/Item/Show3DCamera.cs @@ -27,6 +27,8 @@ public class Show3DCamera : MonoBehaviour private GameObject lastHitObject = null; + public RenderTexture texture; + public bool lockMove = false; private void Awake() { instance = this; @@ -34,7 +36,9 @@ public class Show3DCamera : MonoBehaviour DontDestroyOnLoad(this); gameObject.SetActive(false); } - public void Set(Transform target, float rotateSpeed = 10, float moveSpeed = 0.1f, float distance = 0.1f, float pitchMin = -20, float pitchMax = 80, float distanceMin = 0.2f, float distanceMax = 20f, RectTransform inputRect = null) + + + public void Set(Transform target, float rotateSpeed = 10, float moveSpeed = 0.1f, float distance = 0.1f, float pitchMin = -20, float pitchMax = 80, float distanceMin = 0.2f, float distanceMax = 20f, RectTransform inputRect = null, bool isRenderTexture = true) { if (target == null) { @@ -54,6 +58,15 @@ public class Show3DCamera : MonoBehaviour this.pitchMinMax = new Vector2(pitchMin, pitchMax); // ʼλ offset = new Vector3(0, 0, -distance); + + if (isRenderTexture) + { + self.targetTexture = texture; + } + else + { + self.targetTexture = null; + } UpdateCameraPosition(); } @@ -61,7 +74,7 @@ public class Show3DCamera : MonoBehaviour void Update() { - if (targetPos != null) + if (targetPos != null && lockMove == false) { // סʱת if (Input.GetMouseButton(0)) diff --git a/Assets/Scripts/UI/UIBody3D.Designer.cs b/Assets/Scripts/UI/UIBody3D.Designer.cs index 45de6379..1a76abab 100644 --- a/Assets/Scripts/UI/UIBody3D.Designer.cs +++ b/Assets/Scripts/UI/UIBody3D.Designer.cs @@ -5,7 +5,7 @@ using QFramework; namespace QFramework.Example { - // Generate Id:89fda2e5-1471-418f-9925-5b2ab6cfed6d + // Generate Id:54cc185d-5dba-4a35-a35c-f7ccce574623 public partial class UIBody3D { public const string Name = "UIBody3D"; @@ -19,6 +19,10 @@ namespace QFramework.Example [SerializeField] public UnityEngine.UI.Button DragBack; [SerializeField] + public UnityEngine.UI.Toggle ActiveBtn; + [SerializeField] + public UnityEngine.UI.Button ActiveBack; + [SerializeField] public UnityEngine.UI.Toggle BodyItem; private UIBody3DData mPrivateData = null; @@ -29,6 +33,8 @@ namespace QFramework.Example LeftContent = null; DragBtn = null; DragBack = null; + ActiveBtn = null; + ActiveBack = null; BodyItem = null; mData = null; diff --git a/Assets/Scripts/UI/UIBody3D.cs b/Assets/Scripts/UI/UIBody3D.cs index abba97d4..e9c1352e 100644 --- a/Assets/Scripts/UI/UIBody3D.cs +++ b/Assets/Scripts/UI/UIBody3D.cs @@ -1,11 +1,7 @@ using UnityEngine; using UnityEngine.UI; -using QFramework; using XMLTool; using TMPro; -using System.Drawing; -using System.Collections.Generic; -using DG.Tweening; namespace QFramework.Example { @@ -19,17 +15,23 @@ namespace QFramework.Example { DragBtn.onValueChanged.AddListener(isOn => { - if (isOn) - { - DragBack.gameObject.SetActive(true); - } + DragBtn.transform.Find("SubBtns").gameObject.SetActive(isOn); Body3DController.Instance.allowDrag = isOn; TypeEventSystem.Global.Send(); }); DragBack.onClick.AddListener(() => { DragBtn.isOn = false; - DragBack.gameObject.SetActive(false); + }); + + ActiveBtn.onValueChanged.AddListener(isOn => + { + ActiveBtn.transform.Find("SubBtns").gameObject.SetActive(isOn); + }); + + ActiveBack.onClick.AddListener(() => + { + }); } @@ -37,7 +39,8 @@ namespace QFramework.Example { mData = uiData as UIBody3DData ?? new UIBody3DData(); BodyContent.RemoveAllChildren(); - Utility.FindObj(mData.body.Path).SetActive(true); + GameObject root = Utility.FindObj(mData.body.Path); + root.SetActive(true); foreach (var bodyData in mData.body.subBody) { var body = bodyData.Value; @@ -52,6 +55,10 @@ namespace QFramework.Example obj.SetActive(isOn); }); } + FreeCameraController.instance.gameObject.SetActive(false); + Show3DCamera.instance.gameObject.SetActive(true); + Show3DCamera.instance.Set(root.transform, distance: 5, isRenderTexture: false); + } diff --git a/Assets/Scripts/UI/UI3DBodyInfo.Designer.cs b/Assets/Scripts/UI/UIBody3DInfo.Designer.cs similarity index 83% rename from Assets/Scripts/UI/UI3DBodyInfo.Designer.cs rename to Assets/Scripts/UI/UIBody3DInfo.Designer.cs index 3ac8b8a4..a294d8fb 100644 --- a/Assets/Scripts/UI/UI3DBodyInfo.Designer.cs +++ b/Assets/Scripts/UI/UIBody3DInfo.Designer.cs @@ -6,7 +6,7 @@ using QFramework; namespace QFramework.Example { // Generate Id:6a156460-e46d-43cb-8f5b-c213ad89d195 - public partial class UI3DBodyInfo + public partial class UIBody3DInfo { public const string Name = "UI3DBodyInfo"; @@ -25,7 +25,7 @@ namespace QFramework.Example [SerializeField] public UnityEngine.UI.Toggle TransparentOther; - private UI3DBodyInfoData mPrivateData = null; + private UIBody3DInfoData mPrivateData = null; protected override void ClearUIComponents() { @@ -40,7 +40,7 @@ namespace QFramework.Example mData = null; } - public UI3DBodyInfoData Data + public UIBody3DInfoData Data { get { @@ -48,11 +48,11 @@ namespace QFramework.Example } } - UI3DBodyInfoData mData + UIBody3DInfoData mData { get { - return mPrivateData ?? (mPrivateData = new UI3DBodyInfoData()); + return mPrivateData ?? (mPrivateData = new UIBody3DInfoData()); } set { diff --git a/Assets/Scripts/UI/UI3DBodyInfo.Designer.cs.meta b/Assets/Scripts/UI/UIBody3DInfo.Designer.cs.meta similarity index 100% rename from Assets/Scripts/UI/UI3DBodyInfo.Designer.cs.meta rename to Assets/Scripts/UI/UIBody3DInfo.Designer.cs.meta diff --git a/Assets/Scripts/UI/UI3DBodyInfo.cs b/Assets/Scripts/UI/UIBody3DInfo.cs similarity index 95% rename from Assets/Scripts/UI/UI3DBodyInfo.cs rename to Assets/Scripts/UI/UIBody3DInfo.cs index 061474df..f0282eb7 100644 --- a/Assets/Scripts/UI/UI3DBodyInfo.cs +++ b/Assets/Scripts/UI/UIBody3DInfo.cs @@ -7,11 +7,11 @@ using TMPro; namespace QFramework.Example { - public class UI3DBodyInfoData : UIPanelData + public class UIBody3DInfoData : UIPanelData { public Body3D.Body body; } - public partial class UI3DBodyInfo : UIPanel + public partial class UIBody3DInfo : UIPanel { GameObject obj; protected override void OnInit(IUIData uiData = null) @@ -91,7 +91,7 @@ namespace QFramework.Example protected override void OnOpen(IUIData uiData = null) { - mData = uiData as UI3DBodyInfoData ?? new UI3DBodyInfoData(); + mData = uiData as UIBody3DInfoData ?? new UIBody3DInfoData(); PartName.text = mData.body.Name; obj = Utility.FindObj(mData.body.Path); diff --git a/Assets/Scripts/UI/UI3DBodyInfo.cs.meta b/Assets/Scripts/UI/UIBody3DInfo.cs.meta similarity index 100% rename from Assets/Scripts/UI/UI3DBodyInfo.cs.meta rename to Assets/Scripts/UI/UIBody3DInfo.cs.meta diff --git a/Assets/Scripts/UI/UIModuleSelect.cs b/Assets/Scripts/UI/UIModuleSelect.cs index 73ac941a..61448962 100644 --- a/Assets/Scripts/UI/UIModuleSelect.cs +++ b/Assets/Scripts/UI/UIModuleSelect.cs @@ -81,11 +81,26 @@ namespace QFramework.Example private void OnLoadFinished(Scene arg0, LoadSceneMode arg1) { SceneManager.sceneLoaded -= OnLoadFinished; - var machin = StateMachineController.Instance; - var op = OperationController.Instance; - var dev = DeviceController.Instance; - var body3d = Body3DController.Instance; - ScoreController.Instance.Init(); + if (Global.Instance.curModule.FSM.Count > 0) + { + var machin = StateMachineController.Instance; + } + if (Global.Instance.curModule.Operations != null && Global.Instance.curModule.Operations.Count > 0) + { + var op = OperationController.Instance; + } + if (Global.Instance.curModule.Devices != null && Global.Instance.curModule.Devices.Count > 0) + { + var dev = DeviceController.Instance; + } + if (Global.Instance.curModule.body3d != null) + { + var body3d = Body3DController.Instance; + } + if (Global.Instance.curModule.score != null) + { + ScoreController.Instance.Init(); + } UIKit.OpenPanelAsync().ToAction().StartGlobal(() => { diff --git a/Assets/Scripts/UI/UITextTip.Designer.cs b/Assets/Scripts/UI/UITextTip.Designer.cs index 0e74aa8d..f1187906 100644 --- a/Assets/Scripts/UI/UITextTip.Designer.cs +++ b/Assets/Scripts/UI/UITextTip.Designer.cs @@ -5,11 +5,13 @@ using QFramework; namespace QFramework.Example { - // Generate Id:6e5ebb38-7352-4359-a698-28a6e4ca3f0f + // Generate Id:2bccd644-ac9b-4f30-8f17-4a933167afc1 public partial class UITextTip { public const string Name = "UITextTip"; + [SerializeField] + public TMPro.TextMeshProUGUI Title; [SerializeField] public TMPro.TextMeshProUGUI Des; [SerializeField] @@ -21,6 +23,7 @@ namespace QFramework.Example protected override void ClearUIComponents() { + Title = null; Des = null; BtnContent = null; Btn = null; diff --git a/Assets/Scripts/UI/UITextTip.cs b/Assets/Scripts/UI/UITextTip.cs index 6b66d0cc..ba70f722 100644 --- a/Assets/Scripts/UI/UITextTip.cs +++ b/Assets/Scripts/UI/UITextTip.cs @@ -13,6 +13,7 @@ namespace QFramework.Example { public string text; public string audio; + public string title; public List btns; } public partial class UITextTip : UIPanel @@ -36,15 +37,18 @@ namespace QFramework.Example mData = uiData as UITextTipData ?? new UITextTipData(); Des.text = Regex.Replace(mData.text, @"\\n", "\n"); BtnContent.RemoveAllChildren(); - foreach (var item in mData.btns) + if (mData.btns != null) { - GameObject btn = GameObject.Instantiate(Btn.gameObject, BtnContent); - btn.transform.Find("Label").GetComponent().text = item; - btn.name = item; - btn.GetComponent