添加滑动条控制脚本
This commit is contained in:
parent
f3624ef7b8
commit
ee27bfa00f
File diff suppressed because one or more lines are too long
725
Assets/Art/UIPrefab/UISliderAnim.prefab
Normal file
725
Assets/Art/UIPrefab/UISliderAnim.prefab
Normal file
@ -0,0 +1,725 @@
|
||||
%YAML 1.1
|
||||
%TAG !u! tag:unity3d.com,2011:
|
||||
--- !u!1 &151530828601417753
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 2595133967052343260}
|
||||
- component: {fileID: 4232815537607907880}
|
||||
m_Layer: 5
|
||||
m_Name: Image
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &2595133967052343260
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 151530828601417753}
|
||||
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: 3978028391500618154}
|
||||
- {fileID: 4910365175849963417}
|
||||
m_Father: {fileID: 946527045819641235}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 1, y: 0}
|
||||
m_AnchorMax: {x: 1, y: 0}
|
||||
m_AnchoredPosition: {x: -351.41528, y: 251.92322}
|
||||
m_SizeDelta: {x: 702.8304, y: 503.8465}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4232815537607907880
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 151530828601417753}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &2340646968902467614
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8977862762861949668}
|
||||
- component: {fileID: 5413654080872978174}
|
||||
- component: {fileID: 7612946103489478951}
|
||||
m_Layer: 5
|
||||
m_Name: Background
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8977862762861949668
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2340646968902467614}
|
||||
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: 3422291841848135694}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0.25}
|
||||
m_AnchorMax: {x: 1, y: 0.75}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 0, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &5413654080872978174
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2340646968902467614}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7612946103489478951
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2340646968902467614}
|
||||
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: 10907, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
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!1 &2486453252491754055
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 7811596875401039659}
|
||||
m_Layer: 5
|
||||
m_Name: Fill Area
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &7811596875401039659
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 2486453252491754055}
|
||||
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: 5982957460602276992}
|
||||
m_Father: {fileID: 3422291841848135694}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0.25}
|
||||
m_AnchorMax: {x: 1, y: 0.75}
|
||||
m_AnchoredPosition: {x: -5, y: 0}
|
||||
m_SizeDelta: {x: -20, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &3189325997778811691
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3978028391500618154}
|
||||
- component: {fileID: 7435543090623703973}
|
||||
- component: {fileID: 2685323742858739708}
|
||||
- component: {fileID: 2092374977566157491}
|
||||
m_Layer: 5
|
||||
m_Name: Connet
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3978028391500618154
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3189325997778811691}
|
||||
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: 2595133967052343260}
|
||||
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 &7435543090623703973
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3189325997778811691}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &2685323742858739708
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3189325997778811691}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 59f8146938fff824cb5fd77236b75775, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Padding:
|
||||
m_Left: 80
|
||||
m_Right: 20
|
||||
m_Top: 10
|
||||
m_Bottom: 20
|
||||
m_ChildAlignment: 1
|
||||
m_Spacing: 0
|
||||
m_ChildForceExpandWidth: 1
|
||||
m_ChildForceExpandHeight: 1
|
||||
m_ChildControlWidth: 0
|
||||
m_ChildControlHeight: 0
|
||||
m_ChildScaleWidth: 1
|
||||
m_ChildScaleHeight: 1
|
||||
m_ReverseArrangement: 0
|
||||
--- !u!114 &2092374977566157491
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 3189325997778811691}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
MarkType: 0
|
||||
CustomComponentName: Connet
|
||||
CustomComment:
|
||||
mComponentName: RectTransform
|
||||
--- !u!1 &4852869974954202354
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 3422291841848135694}
|
||||
- component: {fileID: 5337397264140765564}
|
||||
- component: {fileID: 3350844649312235914}
|
||||
m_Layer: 5
|
||||
m_Name: Slider
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &3422291841848135694
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4852869974954202354}
|
||||
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: 8977862762861949668}
|
||||
- {fileID: 7811596875401039659}
|
||||
- {fileID: 8506592173217220154}
|
||||
- {fileID: 1852505976965519165}
|
||||
m_Father: {fileID: 4910365175849963417}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 1}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 80.00003, y: 166.17856}
|
||||
m_SizeDelta: {x: 411.9155, y: 51.4894}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!114 &5337397264140765564
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4852869974954202354}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 67db9e8f0e2ae9c40bc1e2b64352a6b4, 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: 576029333014397181}
|
||||
m_FillRect: {fileID: 5982957460602276992}
|
||||
m_HandleRect: {fileID: 1257332742427623349}
|
||||
m_Direction: 0
|
||||
m_MinValue: 0
|
||||
m_MaxValue: 1
|
||||
m_WholeNumbers: 0
|
||||
m_Value: 0
|
||||
m_OnValueChanged:
|
||||
m_PersistentCalls:
|
||||
m_Calls: []
|
||||
--- !u!114 &3350844649312235914
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 4852869974954202354}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 0d51f3a7c41ab0346b49ae50d456bece, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
MarkType: 0
|
||||
CustomComponentName: Slider
|
||||
CustomComment:
|
||||
mComponentName: UnityEngine.UI.Slider
|
||||
--- !u!1 &5657257549572006007
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 4910365175849963417}
|
||||
- component: {fileID: 3263579343605595289}
|
||||
m_Layer: 5
|
||||
m_Name: Prefabs
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 0
|
||||
--- !u!224 &4910365175849963417
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5657257549572006007}
|
||||
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: 3422291841848135694}
|
||||
m_Father: {fileID: 2595133967052343260}
|
||||
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: 100, y: 100}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &3263579343605595289
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 5657257549572006007}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!1 &6159013821757334261
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 8506592173217220154}
|
||||
m_Layer: 5
|
||||
m_Name: Handle Slide Area
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &8506592173217220154
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6159013821757334261}
|
||||
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: 1257332742427623349}
|
||||
m_Father: {fileID: 3422291841848135694}
|
||||
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: -20, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!1 &6429609947376298444
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 5982957460602276992}
|
||||
- component: {fileID: 886795027398176749}
|
||||
- component: {fileID: 7651356527734081840}
|
||||
m_Layer: 5
|
||||
m_Name: Fill
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &5982957460602276992
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6429609947376298444}
|
||||
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: 7811596875401039659}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: 0, y: 0}
|
||||
m_SizeDelta: {x: 10, y: 0}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &886795027398176749
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6429609947376298444}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &7651356527734081840
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6429609947376298444}
|
||||
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: 10905, guid: 0000000000000000f000000000000000, type: 0}
|
||||
m_Type: 1
|
||||
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!1 &6694362606900500821
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 946527045819641235}
|
||||
- component: {fileID: 3880217740787222117}
|
||||
- component: {fileID: 6395110540204496692}
|
||||
m_Layer: 5
|
||||
m_Name: UISliderAnim
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &946527045819641235
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6694362606900500821}
|
||||
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: 2595133967052343260}
|
||||
m_Father: {fileID: 0}
|
||||
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 &3880217740787222117
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6694362606900500821}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &6395110540204496692
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 6694362606900500821}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 157f9846a4f08a84da68c522584ebefd, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
Connet: {fileID: 3978028391500618154}
|
||||
Slider: {fileID: 5337397264140765564}
|
||||
--- !u!1 &7056407566314005769
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1257332742427623349}
|
||||
- component: {fileID: 4472166067418023870}
|
||||
- component: {fileID: 576029333014397181}
|
||||
m_Layer: 5
|
||||
m_Name: Handle
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1257332742427623349
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7056407566314005769}
|
||||
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: 8506592173217220154}
|
||||
m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0}
|
||||
m_AnchorMin: {x: 0, y: 0}
|
||||
m_AnchorMax: {x: 0, y: 1}
|
||||
m_AnchoredPosition: {x: -0.1000061, y: -1.2649002}
|
||||
m_SizeDelta: {x: 34.6099, y: -15.6814}
|
||||
m_Pivot: {x: 0.5, y: 0.5}
|
||||
--- !u!222 &4472166067418023870
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7056407566314005769}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &576029333014397181
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7056407566314005769}
|
||||
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: 10913, guid: 0000000000000000f000000000000000, type: 0}
|
||||
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!1 &7075527639200585001
|
||||
GameObject:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
serializedVersion: 6
|
||||
m_Component:
|
||||
- component: {fileID: 1852505976965519165}
|
||||
- component: {fileID: 1522089214098487428}
|
||||
- component: {fileID: 6354154796675572376}
|
||||
m_Layer: 5
|
||||
m_Name: TitleText
|
||||
m_TagString: Untagged
|
||||
m_Icon: {fileID: 0}
|
||||
m_NavMeshLayer: 0
|
||||
m_StaticEditorFlags: 0
|
||||
m_IsActive: 1
|
||||
--- !u!224 &1852505976965519165
|
||||
RectTransform:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7075527639200585001}
|
||||
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: 3422291841848135694}
|
||||
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: -4.84906, y: 0.000015258789}
|
||||
m_SizeDelta: {x: 177.5797, y: 70.5698}
|
||||
m_Pivot: {x: 1, y: 0.5}
|
||||
--- !u!222 &1522089214098487428
|
||||
CanvasRenderer:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7075527639200585001}
|
||||
m_CullTransparentMesh: 1
|
||||
--- !u!114 &6354154796675572376
|
||||
MonoBehaviour:
|
||||
m_ObjectHideFlags: 0
|
||||
m_CorrespondingSourceObject: {fileID: 0}
|
||||
m_PrefabInstance: {fileID: 0}
|
||||
m_PrefabAsset: {fileID: 0}
|
||||
m_GameObject: {fileID: 7075527639200585001}
|
||||
m_Enabled: 1
|
||||
m_EditorHideFlags: 0
|
||||
m_Script: {fileID: 11500000, guid: 5f7201a12d95ffc409449d95f23cf332, type: 3}
|
||||
m_Name:
|
||||
m_EditorClassIdentifier:
|
||||
m_Material: {fileID: 0}
|
||||
m_Color: {r: 0.19607843, g: 0.19607843, b: 0.19607843, 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_FontData:
|
||||
m_Font: {fileID: 12800000, guid: ed2dcf76fce32514fbf37799df2d4136, type: 3}
|
||||
m_FontSize: 30
|
||||
m_FontStyle: 0
|
||||
m_BestFit: 1
|
||||
m_MinSize: 2
|
||||
m_MaxSize: 30
|
||||
m_Alignment: 4
|
||||
m_AlignByGeometry: 1
|
||||
m_RichText: 0
|
||||
m_HorizontalOverflow: 0
|
||||
m_VerticalOverflow: 0
|
||||
m_LineSpacing: 1
|
||||
m_Text: "\u6807\u9898\u6587\u5B57"
|
||||
7
Assets/Art/UIPrefab/UISliderAnim.prefab.meta
Normal file
7
Assets/Art/UIPrefab/UISliderAnim.prefab.meta
Normal file
@ -0,0 +1,7 @@
|
||||
fileFormatVersion: 2
|
||||
guid: c7df72f21e03ce64587eed46041adca4
|
||||
PrefabImporter:
|
||||
externalObjects: {}
|
||||
userData:
|
||||
assetBundleName: uislideranim_prefab
|
||||
assetBundleVariant:
|
||||
Binary file not shown.
@ -4,6 +4,9 @@ using System;
|
||||
using System.Text;
|
||||
using System.IO;
|
||||
|
||||
/// <summary>
|
||||
/// 工具箱
|
||||
/// </summary>
|
||||
public class Utility
|
||||
{
|
||||
static Dictionary<string, GameObject> rootGameObjectDict = new Dictionary<string, GameObject>();
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@ -30,7 +30,7 @@ public class ActionHelper
|
||||
{ "UIKnowledge", typeof(QFramework.Example.UIKnowledge) },
|
||||
{ "UIBackPack", typeof(QFramework.Example.UIBackPack) },
|
||||
{ "UIGuideTip", typeof(QFramework.Example.UIGuideTip) },
|
||||
|
||||
{ "UISliderAnim", typeof(QFramework.Example.UISliderAnim) },
|
||||
};
|
||||
|
||||
|
||||
@ -297,7 +297,13 @@ public class ActionHelper
|
||||
return QFramework.GuideTipAction.Allocate(dictAction.args);
|
||||
|
||||
}
|
||||
case "UISliderAnim":
|
||||
{
|
||||
|
||||
var dictAction = (XMLTool.DictionaryAction)act;
|
||||
return QFramework.SliderAnimAction.Allocate(dictAction.args);
|
||||
|
||||
}
|
||||
default:
|
||||
Debug.LogError($"没有找到此Action的类型{act.Type}");
|
||||
break;
|
||||
|
||||
90
Assets/Scripts/Actions/SliderAnimAction.cs
Normal file
90
Assets/Scripts/Actions/SliderAnimAction.cs
Normal file
@ -0,0 +1,90 @@
|
||||
using QFramework;
|
||||
using QFramework.Example;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using UnityEngine;
|
||||
namespace QFramework
|
||||
{
|
||||
|
||||
public class SliderAnimAction: IAction
|
||||
{
|
||||
public System.Action OnFinished
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
public ulong ActionID
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public ActionStatus Status
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public bool Deinited
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
public bool Paused
|
||||
{
|
||||
get; set;
|
||||
}
|
||||
|
||||
private SliderAnimAction()
|
||||
{
|
||||
}
|
||||
|
||||
private static readonly SimpleObjectPool<SliderAnimAction> mPool =
|
||||
new SimpleObjectPool<SliderAnimAction>(() => new(), null, 10);
|
||||
Dictionary<string, string> datas;
|
||||
|
||||
public static SliderAnimAction Allocate(Dictionary<string, string> datas, System.Action onDelayFinish = null)
|
||||
{
|
||||
var retNode = mPool.Allocate();
|
||||
retNode.ActionID = ActionKit.ID_GENERATOR++;
|
||||
retNode.Deinited = false;
|
||||
retNode.Reset();
|
||||
retNode.datas = datas;
|
||||
return retNode;
|
||||
}
|
||||
|
||||
public void Deinit()
|
||||
{
|
||||
if (!Deinited)
|
||||
{
|
||||
Deinited = true;
|
||||
mPool.Recycle(this);
|
||||
}
|
||||
}
|
||||
|
||||
public void OnExecute(float dt)
|
||||
{
|
||||
}
|
||||
|
||||
public void OnFinish()
|
||||
{
|
||||
// Debug.Log("Action OnFinish???");
|
||||
}
|
||||
|
||||
public void OnStart()
|
||||
{
|
||||
UISliderAnimData data = new UISliderAnimData();
|
||||
|
||||
data.title = datas.ContainsKey("title") ? datas["title"] : string.Empty;
|
||||
data.targetObj = datas.ContainsKey("targetObj") ? datas["targetObj"] : string.Empty;
|
||||
|
||||
|
||||
UIKit.OpenPanelAsync<UISliderAnim>(uiData: data, canvasLevel: UILevel.Common).ToAction().StartGlobal(() =>
|
||||
{
|
||||
this.Finish();
|
||||
});
|
||||
|
||||
}
|
||||
|
||||
public void Reset()
|
||||
{
|
||||
Status = ActionStatus.NotStart;
|
||||
Paused = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/Actions/SliderAnimAction.cs.meta
Normal file
11
Assets/Scripts/Actions/SliderAnimAction.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: ffd3f8fb51aa6614d9fdc1ae62825fb4
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
49
Assets/Scripts/UIGuidTip/UISliderAnim.Designer.cs
generated
Normal file
49
Assets/Scripts/UIGuidTip/UISliderAnim.Designer.cs
generated
Normal file
@ -0,0 +1,49 @@
|
||||
using System;
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using QFramework;
|
||||
|
||||
namespace QFramework.Example
|
||||
{
|
||||
// Generate Id:a748cd0b-277f-4457-86d1-72ed210db556
|
||||
public partial class UISliderAnim
|
||||
{
|
||||
public const string Name = "UISliderAnim";
|
||||
|
||||
[SerializeField]
|
||||
public RectTransform Connet;
|
||||
[SerializeField]
|
||||
public UnityEngine.UI.Slider Slider;
|
||||
|
||||
private UISliderAnimData mPrivateData = null;
|
||||
|
||||
protected override void ClearUIComponents()
|
||||
{
|
||||
Connet = null;
|
||||
Slider = null;
|
||||
|
||||
mData = null;
|
||||
}
|
||||
|
||||
public UISliderAnimData Data
|
||||
{
|
||||
get
|
||||
{
|
||||
return mData;
|
||||
}
|
||||
}
|
||||
|
||||
UISliderAnimData mData
|
||||
{
|
||||
get
|
||||
{
|
||||
return mPrivateData ?? (mPrivateData = new UISliderAnimData());
|
||||
}
|
||||
set
|
||||
{
|
||||
mUIData = value;
|
||||
mPrivateData = value;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UIGuidTip/UISliderAnim.Designer.cs.meta
Normal file
11
Assets/Scripts/UIGuidTip/UISliderAnim.Designer.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 1fb9a975dd302f241b3e8a1a009a7ed5
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
112
Assets/Scripts/UIGuidTip/UISliderAnim.cs
Normal file
112
Assets/Scripts/UIGuidTip/UISliderAnim.cs
Normal file
@ -0,0 +1,112 @@
|
||||
using UnityEngine;
|
||||
using UnityEngine.UI;
|
||||
using QFramework;
|
||||
using System.Collections.Generic;
|
||||
using System;
|
||||
using System.Linq;
|
||||
|
||||
namespace QFramework.Example
|
||||
{
|
||||
public class UISliderAnimData : UIPanelData
|
||||
{
|
||||
public string title;
|
||||
public string targetObj;
|
||||
|
||||
}
|
||||
public partial class UISliderAnim : UIPanel
|
||||
{
|
||||
protected override void OnInit(IUIData uiData = null)
|
||||
{
|
||||
mData = uiData as UISliderAnimData ?? new UISliderAnimData();
|
||||
// please add init code here
|
||||
}
|
||||
|
||||
protected override void OnOpen(IUIData uiData = null)
|
||||
{
|
||||
Connet.RemoveAllChildren();
|
||||
|
||||
mData = uiData as UISliderAnimData ?? new UISliderAnimData();
|
||||
if (mData != null)
|
||||
{
|
||||
|
||||
// 解析标题列表
|
||||
List<string> Objs = mData.title.Split('|')?.ToList();
|
||||
List<Slider> sliders = new List<Slider>();
|
||||
|
||||
// 查找目标对象并获取SkinnedMeshRenderer
|
||||
GameObject obj = Utility.FindObj(mData.targetObj.ToString());
|
||||
SkinnedMeshRenderer skinnedRenderer = obj.GetComponent<SkinnedMeshRenderer>();
|
||||
|
||||
if (skinnedRenderer != null)
|
||||
{
|
||||
// 获取共享网格(包含BlendShapes数据)
|
||||
Mesh mesh = skinnedRenderer.sharedMesh;
|
||||
|
||||
// 获取BlendShape数量
|
||||
int blendShapeCount = mesh.blendShapeCount;
|
||||
Debug.Log($"物体 {obj.name} 有 {blendShapeCount} 个BlendShapes");
|
||||
|
||||
// 遍历所有BlendShapes并输出信息
|
||||
for (int i = 0; i < blendShapeCount; i++)
|
||||
{
|
||||
string blendShapeName = mesh.GetBlendShapeName(i);
|
||||
float currentWeight = skinnedRenderer.GetBlendShapeWeight(i);
|
||||
Debug.Log($"BlendShape #{i}: {blendShapeName}, 当前权重: {currentWeight}");
|
||||
}
|
||||
|
||||
// 为每个BlendShape创建对应的Slider
|
||||
for (int i = 0; i < Objs.Count; i++)
|
||||
{
|
||||
if (i < blendShapeCount) // 确保BlendShape索引有效
|
||||
{
|
||||
string blendShapeName = mesh.GetBlendShapeName(i);
|
||||
|
||||
// 实例化Slider预制体
|
||||
GameObject sliderItemObj = GameObject.Instantiate(Slider.gameObject, Connet);
|
||||
sliderItemObj.name = blendShapeName;
|
||||
|
||||
// 设置Slider标题
|
||||
sliderItemObj.transform.Find("TitleText").GetComponent<Text>().text = Objs[i];
|
||||
|
||||
|
||||
// 获取Slider组件并设置初始值
|
||||
Slider slider = sliderItemObj.GetComponent<Slider>();
|
||||
if (slider != null)
|
||||
{
|
||||
slider.minValue = 0f;
|
||||
slider.maxValue = 100f;
|
||||
slider.value = skinnedRenderer.GetBlendShapeWeight(i);
|
||||
|
||||
// 添加值变化事件
|
||||
int blendShapeIndex = i; // 避免闭包捕获问题
|
||||
slider.onValueChanged.AddListener((value) =>
|
||||
{
|
||||
skinnedRenderer.SetBlendShapeWeight(blendShapeIndex, value);
|
||||
});
|
||||
|
||||
sliders.Add(slider);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
Debug.LogError($"物体 {obj.name} 上没有SkinnedMeshRenderer组件!");
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
}
|
||||
protected override void OnShow()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnHide()
|
||||
{
|
||||
}
|
||||
|
||||
protected override void OnClose()
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
||||
11
Assets/Scripts/UIGuidTip/UISliderAnim.cs.meta
Normal file
11
Assets/Scripts/UIGuidTip/UISliderAnim.cs.meta
Normal file
@ -0,0 +1,11 @@
|
||||
fileFormatVersion: 2
|
||||
guid: 157f9846a4f08a84da68c522584ebefd
|
||||
MonoImporter:
|
||||
externalObjects: {}
|
||||
serializedVersion: 2
|
||||
defaultReferences: []
|
||||
executionOrder: 0
|
||||
icon: {instanceID: 0}
|
||||
userData:
|
||||
assetBundleName:
|
||||
assetBundleVariant:
|
||||
@ -1792,6 +1792,31 @@ namespace XMLTool
|
||||
|
||||
|
||||
break;
|
||||
|
||||
case "UISliderAnim":
|
||||
{
|
||||
|
||||
|
||||
|
||||
|
||||
var act = new DictionaryAction();
|
||||
XAttribute title = action.Attribute("title");
|
||||
if (title != null)
|
||||
{
|
||||
act.args.Add("title", title.Value);
|
||||
}
|
||||
XAttribute targetObj = action.Attribute("targetObj");
|
||||
if (targetObj != null)
|
||||
{
|
||||
act.args.Add("targetObj", targetObj.Value);
|
||||
}
|
||||
newAction = act;
|
||||
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
|
||||
default:
|
||||
newAction = new Action();
|
||||
break;
|
||||
|
||||
@ -114,6 +114,11 @@
|
||||
tiptitle="棱柱上底面|棱柱上底面边长|棱柱底面|棱柱底面边长|棱柱侧面|侧棱|棱柱棱高|棱柱顶点"
|
||||
|
||||
></Action>
|
||||
<Action type="UISliderAnim" title="棱柱倾斜度|底面边长|上底面边长|棱高" targetObj="Main/A_SM_LengZhu"> </Action>
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
</Action>
|
||||
</Enter>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user