添加创建按钮功能,修改UIbtn脚本

This commit is contained in:
李浩 2025-05-28 11:38:55 +08:00
parent 2c02e7b26d
commit 3aa5959942
11 changed files with 1031 additions and 181 deletions

File diff suppressed because one or more lines are too long

View File

@ -337,8 +337,8 @@ RectTransform:
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0.5} m_AnchorMin: {x: 0, y: 0.5}
m_AnchorMax: {x: 0, y: 0.5} m_AnchorMax: {x: 0, y: 0.5}
m_AnchoredPosition: {x: 8, y: 67} m_AnchoredPosition: {x: 5, y: 0}
m_SizeDelta: {x: 245.2674, y: 596.4644} m_SizeDelta: {x: 245.2674, y: 537.2426}
m_Pivot: {x: 0, y: 0.5} m_Pivot: {x: 0, y: 0.5}
--- !u!222 &1831670476936566405 --- !u!222 &1831670476936566405
CanvasRenderer: CanvasRenderer:

View File

@ -32,10 +32,10 @@ RectTransform:
m_Children: [] m_Children: []
m_Father: {fileID: 5906899631122746265} m_Father: {fileID: 5906899631122746265}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0, y: 0}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 1, y: 1}
m_AnchoredPosition: {x: 51, y: -17} m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 6.53, y: 22.41} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &6411560307822351666 --- !u!222 &6411560307822351666
CanvasRenderer: CanvasRenderer:
@ -178,7 +178,7 @@ MonoBehaviour:
m_PrefabInstance: {fileID: 0} m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 2587655409017112171} m_GameObject: {fileID: 2587655409017112171}
m_Enabled: 1 m_Enabled: 0
m_EditorHideFlags: 0 m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3} m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
m_Name: m_Name:
@ -249,11 +249,11 @@ RectTransform:
- {fileID: 6909120277996090269} - {fileID: 6909120277996090269}
m_Father: {fileID: 4586469886604357432} m_Father: {fileID: 4586469886604357432}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1} m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0, y: 1} m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 1869, y: -989.01276} m_AnchoredPosition: {x: 0, y: -17}
m_SizeDelta: {x: 102, y: 34} m_SizeDelta: {x: 102, y: 34}
m_Pivot: {x: 0.5, y: 1} m_Pivot: {x: 0.5, y: 0.5}
--- !u!222 &1746722721080050049 --- !u!222 &1746722721080050049
CanvasRenderer: CanvasRenderer:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -311,7 +311,7 @@ MonoBehaviour:
m_SelectOnDown: {fileID: 0} m_SelectOnDown: {fileID: 0}
m_SelectOnLeft: {fileID: 0} m_SelectOnLeft: {fileID: 0}
m_SelectOnRight: {fileID: 0} m_SelectOnRight: {fileID: 0}
m_Transition: 0 m_Transition: 1
m_Colors: m_Colors:
m_NormalColor: {r: 1, g: 1, b: 1, a: 1} m_NormalColor: {r: 1, g: 1, b: 1, a: 1}
m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1} m_HighlightedColor: {r: 0.9607843, g: 0.9607843, b: 0.9607843, a: 1}
@ -421,9 +421,9 @@ RectTransform:
- {fileID: 5906899631122746265} - {fileID: 5906899631122746265}
m_Father: {fileID: 3292507068126063065} m_Father: {fileID: 3292507068126063065}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 0} m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 1, y: 1} m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 0, y: 0} m_AnchoredPosition: {x: 1920, y: 0}
m_SizeDelta: {x: 0, y: 0} m_SizeDelta: {x: 0, y: 0}
m_Pivot: {x: 0.5, y: 0.5} m_Pivot: {x: 0.5, y: 0.5}
--- !u!1 &8109171602776719836 --- !u!1 &8109171602776719836

View File

@ -294,6 +294,183 @@ MeshFilter:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 151912019} m_GameObject: {fileID: 151912019}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &220963758
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 220963759}
- component: {fileID: 220963764}
- component: {fileID: 220963763}
- component: {fileID: 220963762}
- component: {fileID: 220963761}
- component: {fileID: 220963760}
m_Layer: 5
m_Name: BtnPrefab (1)
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &220963759
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 220963758}
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: 492170760}
m_Father: {fileID: 1763219365}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0.5, y: 0.5}
m_AnchorMax: {x: 0.5, y: 0.5}
m_AnchoredPosition: {x: 0, y: 0}
m_SizeDelta: {x: 102, y: 34}
m_Pivot: {x: 0.5, y: 1}
--- !u!114 &220963760
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 220963758}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 30649d3a9faa99c48a7b1166b86bf2a0, type: 3}
m_Name:
m_EditorClassIdentifier:
m_Padding:
m_Left: 10
m_Right: 10
m_Top: 0
m_Bottom: 0
m_ChildAlignment: 4
m_Spacing: 0
m_ChildForceExpandWidth: 0
m_ChildForceExpandHeight: 0
m_ChildControlWidth: 1
m_ChildControlHeight: 1
m_ChildScaleWidth: 1
m_ChildScaleHeight: 0
m_ReverseArrangement: 0
--- !u!114 &220963761
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 220963758}
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 &220963762
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 220963758}
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: 0
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: 220963763}
m_OnClick:
m_PersistentCalls:
m_Calls:
- m_Target: {fileID: 0}
m_TargetAssemblyTypeName: UnityEngine.UI.Toggle, UnityEngine.UI
m_MethodName: set_isOn
m_Mode: 6
m_Arguments:
m_ObjectArgument: {fileID: 0}
m_ObjectArgumentAssemblyTypeName: UnityEngine.Object, UnityEngine
m_IntArgument: 0
m_FloatArgument: 0
m_StringArgument:
m_BoolArgument: 0
m_CallState: 2
--- !u!114 &220963763
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 220963758}
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!222 &220963764
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 220963758}
m_CullTransparentMesh: 1
--- !u!1 &240304286 --- !u!1 &240304286
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -920,6 +1097,140 @@ Light:
m_UseViewFrustumForShadowCasterCull: 1 m_UseViewFrustumForShadowCasterCull: 1
m_ShadowRadius: 0 m_ShadowRadius: 0
m_ShadowAngle: 0 m_ShadowAngle: 0
--- !u!1 &492170759
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 492170760}
- component: {fileID: 492170762}
- component: {fileID: 492170761}
m_Layer: 5
m_Name: Label
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 1
--- !u!224 &492170760
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 492170759}
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: 220963759}
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
m_AnchorMin: {x: 0, y: 1}
m_AnchorMax: {x: 0, y: 1}
m_AnchoredPosition: {x: 51, y: -17}
m_SizeDelta: {x: 6.53, y: 22.41}
m_Pivot: {x: 0.5, y: 0.5}
--- !u!114 &492170761
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 492170759}
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: 0
m_RaycastPadding: {x: 0, y: 0, z: 0, w: 0}
m_Maskable: 1
m_OnCullStateChanged:
m_PersistentCalls:
m_Calls: []
m_text: 1
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: 1
m_VerticalAlignment: 256
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!222 &492170762
CanvasRenderer:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 492170759}
m_CullTransparentMesh: 1
--- !u!1 &540658882 --- !u!1 &540658882
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -2416,6 +2727,108 @@ MeshFilter:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1100002566} m_GameObject: {fileID: 1100002566}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1 &1213346167
GameObject:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
serializedVersion: 6
m_Component:
- component: {fileID: 1213346171}
- component: {fileID: 1213346170}
- component: {fileID: 1213346169}
- component: {fileID: 1213346168}
m_Layer: 5
m_Name: Canvas
m_TagString: Untagged
m_Icon: {fileID: 0}
m_NavMeshLayer: 0
m_StaticEditorFlags: 0
m_IsActive: 0
--- !u!114 &1213346168
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1213346167}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: dc42784cf147c0c48a680349fa168899, type: 3}
m_Name:
m_EditorClassIdentifier:
m_IgnoreReversedGraphics: 1
m_BlockingObjects: 0
m_BlockingMask:
serializedVersion: 2
m_Bits: 4294967295
--- !u!114 &1213346169
MonoBehaviour:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1213346167}
m_Enabled: 1
m_EditorHideFlags: 0
m_Script: {fileID: 11500000, guid: 0cd44c1031e13a943bb63640046fad76, type: 3}
m_Name:
m_EditorClassIdentifier:
m_UiScaleMode: 0
m_ReferencePixelsPerUnit: 100
m_ScaleFactor: 1
m_ReferenceResolution: {x: 800, y: 600}
m_ScreenMatchMode: 0
m_MatchWidthOrHeight: 0
m_PhysicalUnit: 3
m_FallbackScreenDPI: 96
m_DefaultSpriteDPI: 96
m_DynamicPixelsPerUnit: 1
m_PresetInfoIsWorld: 0
--- !u!223 &1213346170
Canvas:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1213346167}
m_Enabled: 1
serializedVersion: 3
m_RenderMode: 0
m_Camera: {fileID: 0}
m_PlaneDistance: 100
m_PixelPerfect: 0
m_ReceivesEvents: 1
m_OverrideSorting: 0
m_OverridePixelPerfect: 0
m_SortingBucketNormalizedSize: 0
m_VertexColorAlwaysGammaSpace: 0
m_AdditionalShaderChannelsFlag: 25
m_UpdateRectTransformForStandalone: 0
m_SortingLayerID: 0
m_SortingOrder: 0
m_TargetDisplay: 0
--- !u!224 &1213346171
RectTransform:
m_ObjectHideFlags: 0
m_CorrespondingSourceObject: {fileID: 0}
m_PrefabInstance: {fileID: 0}
m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1213346167}
m_LocalRotation: {x: 0, y: 0, z: 0, w: 1}
m_LocalPosition: {x: 0, y: 0, z: 0}
m_LocalScale: {x: 0, y: 0, z: 0}
m_ConstrainProportionsScale: 0
m_Children:
- {fileID: 1763219364}
m_Father: {fileID: 0}
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: 0, y: 0}
m_Pivot: {x: 0, y: 0}
--- !u!1 &1254165907 --- !u!1 &1254165907
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3307,6 +3720,128 @@ MeshFilter:
m_PrefabAsset: {fileID: 0} m_PrefabAsset: {fileID: 0}
m_GameObject: {fileID: 1763056379} m_GameObject: {fileID: 1763056379}
m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0} m_Mesh: {fileID: 10202, guid: 0000000000000000e000000000000000, type: 0}
--- !u!1001 &1763219363
PrefabInstance:
m_ObjectHideFlags: 0
serializedVersion: 2
m_Modification:
serializedVersion: 3
m_TransformParent: {fileID: 1213346171}
m_Modifications:
- target: {fileID: 1063180806212692488, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_AnchorMax.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1063180806212692488, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_AnchorMin.y
value: 1
objectReference: {fileID: 0}
- target: {fileID: 1063180806212692488, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_AnchoredPosition.x
value: 1920
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_Pivot.x
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_Pivot.y
value: 0.5
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_AnchorMax.x
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_AnchorMax.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_AnchorMin.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_AnchorMin.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_SizeDelta.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_SizeDelta.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_LocalPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_LocalPosition.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_LocalPosition.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_LocalRotation.w
value: 1
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_LocalRotation.x
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_LocalRotation.y
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_LocalRotation.z
value: -0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_AnchoredPosition.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_AnchoredPosition.y
value: 46.206665
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_LocalEulerAnglesHint.x
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_LocalEulerAnglesHint.y
value: 0
objectReference: {fileID: 0}
- target: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_LocalEulerAnglesHint.z
value: 0
objectReference: {fileID: 0}
- target: {fileID: 8109171602776719836, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
propertyPath: m_Name
value: UIBtns
objectReference: {fileID: 0}
m_RemovedComponents: []
m_RemovedGameObjects: []
m_AddedGameObjects:
- targetCorrespondingSourceObject: {fileID: 1063180806212692488, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
insertIndex: -1
addedObject: {fileID: 220963759}
m_AddedComponents: []
m_SourcePrefab: {fileID: 100100000, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
--- !u!224 &1763219364 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 3292507068126063065, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
m_PrefabInstance: {fileID: 1763219363}
m_PrefabAsset: {fileID: 0}
--- !u!224 &1763219365 stripped
RectTransform:
m_CorrespondingSourceObject: {fileID: 1063180806212692488, guid: 7cdfaf99908d99b4698101d27f4ca55b, type: 3}
m_PrefabInstance: {fileID: 1763219363}
m_PrefabAsset: {fileID: 0}
--- !u!1 &1821902537 --- !u!1 &1821902537
GameObject: GameObject:
m_ObjectHideFlags: 0 m_ObjectHideFlags: 0
@ -3874,3 +4409,4 @@ SceneRoots:
- {fileID: 2032176038} - {fileID: 2032176038}
- {fileID: 719047897} - {fileID: 719047897}
- {fileID: 1957158068} - {fileID: 1957158068}
- {fileID: 1213346171}

View File

@ -111,8 +111,8 @@ public class ActionHelper
case "Scale": case "Scale":
var scaleAct = (XMLTool.MoveOrAction)act; var scaleAct = (XMLTool.MoveOrAction)act;
return ScaleAction.Allocate(act.Value, scaleAct.to, scaleAct.time); return ScaleAction.Allocate(act.Value, scaleAct.to, scaleAct.time);
case "Btns": //case "Btns":
return BtnsAction.Allocate(act.Value); // return BtnsAction.Allocate(act.Value);
case "Anim": case "Anim":
{ {
var strAction = (XMLTool.DictionaryAction)act; var strAction = (XMLTool.DictionaryAction)act;
@ -304,6 +304,14 @@ public class ActionHelper
return QFramework.SliderAnimAction.Allocate(dictAction.args); return QFramework.SliderAnimAction.Allocate(dictAction.args);
} }
case "Greatbtns":
{
var dictAction = (XMLTool.DictionaryAction)act;
return QFramework.BtnsAction.Allocate(dictAction.args);
}
default: default:
Debug.LogError($"ûÓÐÕÒµ½´ËActionµÄÀàÐÍ{act.Type}"); Debug.LogError($"ûÓÐÕÒµ½´ËActionµÄÀàÐÍ{act.Type}");
break; break;

View File

@ -4,23 +4,42 @@ using UnityEngine;
using QFramework; using QFramework;
using System; using System;
using QFramework.Example; using QFramework.Example;
public class BtnsAction : IAction namespace QFramework
{ {
public ulong ActionID { get; set; } public class BtnsAction : IAction
public bool Deinited { get; set; } {
public bool Paused { get; set; } public ulong ActionID
public ActionStatus Status { get; set; } {
get; set;
}
public bool Deinited
{
get; set;
}
public bool Paused
{
get; set;
}
public ActionStatus Status
{
get; set;
}
private static readonly SimpleObjectPool<BtnsAction> mPool = private static readonly SimpleObjectPool<BtnsAction> mPool =
new SimpleObjectPool<BtnsAction>(() => new BtnsAction(), null, 10); new SimpleObjectPool<BtnsAction>(() => new BtnsAction(), null, 10);
string btnStr = string.Empty; string btnStr = string.Empty;
public static BtnsAction Allocate(string btnStr, System.Action onDelayFinish = null) public Dictionary<string, string> datas;
public static BtnsAction Allocate(Dictionary<string, string> datas, System.Action onDelayFinish = null)
{ {
var retNode = mPool.Allocate(); var retNode = mPool.Allocate();
retNode.ActionID = ActionKit.ID_GENERATOR++; retNode.ActionID = ActionKit.ID_GENERATOR++;
retNode.Deinited = false; retNode.Deinited = false;
retNode.Reset(); retNode.Reset();
retNode.btnStr = btnStr; // retNode.btnStr = btnStr;
retNode.datas = datas;
return retNode; return retNode;
} }
@ -46,12 +65,16 @@ public class BtnsAction : IAction
public void OnStart() public void OnStart()
{ {
UIBtnsData data = new UIBtnsData(); UIBtnsData data = new UIBtnsData();
var btns = btnStr.Split(','); // var btns = btnStr.Split(',');
foreach (var item in btns) //foreach (var item in btns)
{ //{
data.btns.Add(item); // data.btns.Add(item);
} //}
UIKit.OpenPanelAsync<UIBtns>(uiData: data, canvasLevel: UILevel.RightBottom).ToAction().StartGlobal(() => this.Finish()); data.name = datas.ContainsKey("name") ? datas["name"] : string.Empty;
data.pos = datas.ContainsKey("pos") ? datas["pos"] : string.Empty;
data.size = datas.ContainsKey("size") ? datas["size"] : string.Empty;
UIKit.OpenPanelAsync<UIBtns>(uiData: data, canvasLevel: UILevel.Common).ToAction().StartGlobal(() => this.Finish());
} }
public void Reset() public void Reset()
@ -59,4 +82,5 @@ public class BtnsAction : IAction
Status = ActionStatus.NotStart; Status = ActionStatus.NotStart;
Paused = false; Paused = false;
} }
}
} }

View File

@ -71,13 +71,12 @@ namespace QFramework.Example
bg.rectTransform.anchorMin = new Vector2(0, 0.5f); // 左下锚点(右侧) bg.rectTransform.anchorMin = new Vector2(0, 0.5f); // 左下锚点(右侧)
bg.rectTransform.anchorMax = new Vector2(0, 0.5f); // 右上锚点(右侧) bg.rectTransform.anchorMax = new Vector2(0, 0.5f); // 右上锚点(右侧)
// 将位置偏移归零(相对于锚点)
bg.rectTransform.anchoredPosition = Vector2.zero;
// 可选:设置轴心点为右侧中点(影响缩放/旋转中心)
bg.rectTransform.pivot = new Vector2(0, 0.5f);
bg.rectTransform.anchoredPosition = new Vector3(5, 55, 0); // 可选:设置轴心点为右侧中点(影响缩放/旋转中心)
bg.rectTransform.pivot = new Vector2(0, 0.5f);
//bg.rectTransform.anchoredPosition = new Vector3(5, 55, 0);
break; break;
case "right": case "right":
default: default:

View File

@ -5,12 +5,16 @@ using System.Collections.Generic;
using TMPro; using TMPro;
using static OperationController; using static OperationController;
using System; using System;
using System.Linq;
namespace QFramework.Example namespace QFramework.Example
{ {
public class UIBtnsData : UIPanelData public class UIBtnsData : UIPanelData
{ {
public List<string> btns = new List<string>(); public List<string> btns = new List<string>();
public string name;
public string pos;
public string size;
} }
public partial class UIBtns : UIPanel public partial class UIBtns : UIPanel
{ {
@ -31,17 +35,40 @@ namespace QFramework.Example
TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject); TypeEventSystem.Global.Register<StepStatusOnChange>(OnStepChanged).UnRegisterWhenDisabled(gameObject);
mData = uiData as UIBtnsData ?? new UIBtnsData(); mData = uiData as UIBtnsData ?? new UIBtnsData();
BtnContent.RemoveAllChildren(); BtnContent.RemoveAllChildren();
foreach (var item in mData.btns)
{
List<String> btnnames = mData.name.Split('|')?.ToList();
List<String> pos = mData.pos.Split('|')?.ToList();
List<String> size = mData.size.Split('|')?.ToList();
for (int i = 0; i < btnnames.Count; i++) {
int j = i;
GameObject obj = GameObject.Instantiate(BtnPrefab.gameObject, BtnContent); GameObject obj = GameObject.Instantiate(BtnPrefab.gameObject, BtnContent);
obj.name = item;
obj.transform.Find("Label").GetComponent<TextMeshProUGUI>().text = item; obj.name = btnnames[j];
obj.GetComponent<Button>().onClick.AddListener(() => Vector2 positem = Utility.GetVector2FromStrArray(pos[j]);
{ Vector2 sizeData = Utility.GetVector2FromStrArray(size[j]);
Hide(); obj.transform.Find("Label").GetComponent<TextMeshProUGUI>().text= btnnames[j];
}); obj.GetComponent<RectTransform>().sizeDelta = sizeData;
obj.GetComponent<RectTransform>().position = positem;
} }
//foreach (var item in mData.btns)
//{
// GameObject obj = GameObject.Instantiate(BtnPrefab.gameObject, BtnContent);
// obj.name = item;
// obj.transform.Find("Label").GetComponent<TextMeshProUGUI>().text = item;
// obj.GetComponent<Button>().onClick.AddListener(() =>
// {
// Hide();
// });
//}
} }
protected override void OnShow() protected override void OnShow()

View File

@ -44,14 +44,14 @@ namespace QFramework.Example
// 获取BlendShape数量 // 获取BlendShape数量
int blendShapeCount = mesh.blendShapeCount; int blendShapeCount = mesh.blendShapeCount;
Debug.Log($"物体 {obj.name} 有 {blendShapeCount} 个BlendShapes"); // Debug.Log($"物体 {obj.name} 有 {blendShapeCount} 个BlendShapes");
// 遍历所有BlendShapes并输出信息 // 遍历所有BlendShapes并输出信息
for (int i = 0; i < blendShapeCount; i++) for (int i = 0; i < blendShapeCount; i++)
{ {
string blendShapeName = mesh.GetBlendShapeName(i); string blendShapeName = mesh.GetBlendShapeName(i);
float currentWeight = skinnedRenderer.GetBlendShapeWeight(i); float currentWeight = skinnedRenderer.GetBlendShapeWeight(i);
Debug.Log($"BlendShape #{i}: {blendShapeName}, 当前权重: {currentWeight}"); // Debug.Log($"BlendShape #{i}: {blendShapeName}, 当前权重: {currentWeight}");
} }
// 为每个BlendShape创建对应的Slider // 为每个BlendShape创建对应的Slider

View File

@ -6,15 +6,18 @@ using System.IO;
using System.Linq; using System.Linq;
using System.Xml; using System.Xml;
using System.Xml.Linq; using System.Xml.Linq;
using System.Xml.Serialization;
using UnityEngine; using UnityEngine;
using static XMLTool.Body3D; using static XMLTool.Body3D;
namespace XMLTool namespace XMLTool
{ {
public class AppData public class AppData
{ {
public PreLoad preLoad; public PreLoad preLoad;
public List<Module> Modules { get; set; } public List<Module> Modules
{
get; set;
}
} }
@ -26,19 +29,46 @@ namespace XMLTool
public class Module public class Module
{ {
public string type { get; set; } public string type
public string Scene { get; set; } {
public string ModuleName { get; set; } get; set;
public string Descript { get; set; } }
public string Scene
{
get; set;
}
public string ModuleName
{
get; set;
}
public string Descript
{
get; set;
}
public string OnlyCurScore { get; set; } public string OnlyCurScore
public string Icon { get; set; } {
get; set;
}
public string Icon
{
get; set;
}
public List<Operation> Operations { get; set; } public List<Operation> Operations
public List<Device> Devices { get; set; } {
get; set;
}
public List<Device> Devices
{
get; set;
}
public Dictionary<string, FSM> FSM = new Dictionary<string, FSM>(); public Dictionary<string, FSM> FSM = new Dictionary<string, FSM>();
public Dictionary<string, Action> ActionDict { get; set; } public Dictionary<string, Action> ActionDict
{
get; set;
}
public Score score; public Score score;
@ -49,14 +79,38 @@ namespace XMLTool
public class Device public class Device
{ {
public string Name { get; set; } public string Name
public string Icon { get; set; } {
public string HighColor { get; set; } get; set;
public string Path { get; set; } }
public string Tip { get; set; } public string Icon
public string BoxColliderSize { get; set; } {
public string BoxColliderCenter { get; set; } get; set;
public bool MeshCollider { get; set; } }
public string HighColor
{
get; set;
}
public string Path
{
get; set;
}
public string Tip
{
get; set;
}
public string BoxColliderSize
{
get; set;
}
public string BoxColliderCenter
{
get; set;
}
public bool MeshCollider
{
get; set;
}
// 可以限制场景中一共有多少个此道具 -1 代表无限多 // 可以限制场景中一共有多少个此道具 -1 代表无限多
public int Count = -1; public int Count = -1;
@ -91,10 +145,22 @@ namespace XMLTool
public class ActionItem public class ActionItem
{ {
public string Name { get; set; } public string Name
public string Type { get; set; } {
public string Value { get; set; } get; set;
public List<ActionItem> SubActions { get; set; } }
public string Type
{
get; set;
}
public string Value
{
get; set;
}
public List<ActionItem> SubActions
{
get; set;
}
} }
@ -138,48 +204,108 @@ namespace XMLTool
public class FSM public class FSM
{ {
public string Name { get; set; } public string Name
public List<Transision> Transisions { get; set; } {
public Dictionary<string, State> StateDict { get; set; } get; set;
}
public List<Transision> Transisions
{
get; set;
}
public Dictionary<string, State> StateDict
{
get; set;
}
} }
public class State public class State
{ {
public string Name { get; set; } public string Name
public StatePart Enter { get; set; } {
public StatePart Exit { get; set; } get; set;
}
public StatePart Enter
{
get; set;
}
public StatePart Exit
{
get; set;
}
} }
public class StatePart public class StatePart
{ {
public Action Action { get; set; } public Action Action
{
get; set;
}
} }
public class Transision public class Transision
{ {
public string Name { get; set; } public string Name
public string From { get; set; } {
public string To { get; set; } get; set;
public Condition Action { get; set; } }
public string From
{
get; set;
}
public string To
{
get; set;
}
public Condition Action
{
get; set;
}
} }
public class Operation public class Operation
{ {
public string name; public string name;
public string moduleType { get; set; } public string moduleType
public bool freeStep { get; set; } {
public List<Step> Steps { get; set; } get; set;
}
public bool freeStep
{
get; set;
}
public List<Step> Steps
{
get; set;
}
} }
public class Step public class Step
{ {
public Step Parent { get; set; } public Step Parent
public string Name { get; set; } {
public Action Reset { get; set; } get; set;
public Action Start { get; set; } }
public Action Finished { get; set; } public string Name
{
get; set;
}
public Action Reset
{
get; set;
}
public Action Start
{
get; set;
}
public Action Finished
{
get; set;
}
public bool isFinished = false; public bool isFinished = false;
public List<Step> SubSteps { get; set; } public List<Step> SubSteps
{
get; set;
}
} }
@ -187,15 +313,33 @@ namespace XMLTool
{ {
public class Body public class Body
{ {
public string Icon { get; set; } public string Icon
public string Name { get; set; } {
public string Path { get; set; } get; set;
}
public string Name
{
get; set;
}
public string Path
{
get; set;
}
public string Tip { get; set; } public string Tip
{
get; set;
}
public string Audio { get; set; } public string Audio
{
get; set;
}
public string FocusDistance { get; set; } public string FocusDistance
{
get; set;
}
public bool isShow = false; public bool isShow = false;
@ -1752,7 +1896,7 @@ namespace XMLTool
var act = new DictionaryAction(); var act = new DictionaryAction();
XAttribute targetName = action.Attribute("targetName"); XAttribute targetName = action.Attribute("targetName");
if (targetName!=null) if (targetName != null)
{ {
act.args.Add("targetName", targetName.Value); act.args.Add("targetName", targetName.Value);
@ -1815,7 +1959,40 @@ namespace XMLTool
} }
break; break;
case "Greatbtns":
{
var act = new DictionaryAction();
XAttribute name = action.Attribute("name");
if (name != null)
{
act.args.Add("name", name.Value);
}
XAttribute pos = action.Attribute("pos");
if (pos != null)
{
act.args.Add("pos", pos.Value);
}
XAttribute size = action.Attribute("size");
if (size != null)
{
act.args.Add("size", size.Value);
}
newAction = act;
}
break;
case "UISliderAnimReSet": {
}break;
default: default:
newAction = new Action(); newAction = new Action();

View File

@ -116,6 +116,7 @@
></Action> ></Action>
<Action type="UISliderAnim" title="棱柱倾斜度|底面边长|上底面边长|棱高" targetObj="Main/A_SM_LengZhu"> </Action> <Action type="UISliderAnim" title="棱柱倾斜度|底面边长|上底面边长|棱高" targetObj="Main/A_SM_LengZhu"> </Action>
<Action type="Greatbtns" name="动态三维建模|分类对比学习" pos="-1852.3,322.3|-1723.994,322.3" size="125,70|125,70" />
@ -177,6 +178,7 @@
></Action> ></Action>
<Action type="UISliderAnim" title="棱柱倾斜度|底面边长|上底面边长|棱高" targetObj="Main/A_SM_LengZhu"> </Action>
@ -234,6 +236,7 @@
></Action> ></Action>
<Action type="UISliderAnim" title="棱锥底面|棱锥底面边长|棱锥侧面|棱锥侧棱|棱锥棱高|棱锥顶点" targetObj="Main/A_SM_LengZhui"> </Action>
</Action> </Action>
@ -267,13 +270,9 @@
tiptitle="球体圆心|球体半径" tiptitle="球体圆心|球体半径"
></Action> ></Action>
<Action type="UISliderAnim" title="半径" targetObj="Main/A_SM_QiuTi"> </Action>
<!--<Action type="TextWindow" title="球说明" value="球:以半圆直径所在的直线为旋转轴旋转一周,所形成的曲面叫作球面,球面所围成的几何
体叫作球体,简称球.
半圆的圆心叫作球心
半圆的半径叫作球的半径
以半圆直径所在的直线为旋转轴旋转一周,所形成的曲面叫作球面,球面所围成的几何
体叫作球体,简称球。" position="right" scrollSpeed="25"/>-->
</Action> </Action>
</Enter> </Enter>
@ -312,12 +311,10 @@
两个底面间的距离叫作圆柱的高。" 两个底面间的距离叫作圆柱的高。"
tipaudio=" sound29.mp3|sound30.mp3|sound31.mp3|sound32.mp3|sound33.mp3 " tipaudio=" sound29.mp3|sound30.mp3|sound31.mp3|sound32.mp3|sound33.mp3 "
tiptitle="圆柱轴|圆柱底面|圆柱侧面|圆柱母线|圆柱高" tiptitle="圆柱轴|圆柱底面|圆柱侧面|圆柱母线|圆柱高"
></Action> ></Action>
<Action type="UISliderAnim" title="圆柱轴|圆柱底面|圆柱侧面|圆柱母线|圆柱高" targetObj="Main/A_SM_YuanZhu"> </Action>
<Action type="Log" value="圆柱FINISH"></Action>
</Action> </Action>
</Enter> </Enter>
@ -354,6 +351,7 @@
></Action> ></Action>
<!--<Action type="UIShow" value="UIGuideTip" isShow="true"></Action>--> <!--<Action type="UIShow" value="UIGuideTip" isShow="true"></Action>-->
<Action type="UISliderAnim" title="底面半径|圆锥高|圆锥倾斜度" targetObj="Main/A_SM_YuanZhui"> </Action>