From 54469fff5357e878549ba247431749ad6fec86be Mon Sep 17 00:00:00 2001 From: wulongxiao <2545507770@qq.com> Date: Sat, 28 Dec 2024 16:24:08 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BD=93=E5=8A=9B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ui/scene_main/Battle_Selection.prefab | 32 +-- .../Assets/Resources/Prefabs/MainPanel.prefab | 234 +++--------------- .../script/UI_prefabs/Battle_Selection.cs | 10 +- .../Assets/script/scene_Main/DownPanel.cs | 4 +- .../Assets/script/scene_Main/ui/StaminaBar.cs | 69 ++++++ .../script/scene_Main/ui/StaminaBar.cs.meta | 11 + 6 files changed, 132 insertions(+), 228 deletions(-) create mode 100644 meng_yao/Assets/script/scene_Main/ui/StaminaBar.cs create mode 100644 meng_yao/Assets/script/scene_Main/ui/StaminaBar.cs.meta diff --git a/meng_yao/Assets/Prefabs/ui/scene_main/Battle_Selection.prefab b/meng_yao/Assets/Prefabs/ui/scene_main/Battle_Selection.prefab index 22e801e0d..548dfa315 100644 --- a/meng_yao/Assets/Prefabs/ui/scene_main/Battle_Selection.prefab +++ b/meng_yao/Assets/Prefabs/ui/scene_main/Battle_Selection.prefab @@ -732,10 +732,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 2 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 628.68, y: -174.5} - m_SizeDelta: {x: 264, y: 349} + 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.5, y: 0.5} --- !u!222 &514399549474802177 CanvasRenderer: @@ -1165,10 +1165,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 132, y: -174.5} - m_SizeDelta: {x: 264, y: 349} + 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.5, y: 0.5} --- !u!222 &1106133910927903845 CanvasRenderer: @@ -1470,10 +1470,10 @@ RectTransform: m_Father: {fileID: 8646173537342263721} m_RootOrder: 1 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 380.34, y: -174.5} - m_SizeDelta: {x: 264, y: 349} + 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.5, y: 0.5} --- !u!222 &6130671505914922423 CanvasRenderer: @@ -5291,10 +5291,10 @@ RectTransform: m_Father: {fileID: 8646173537015180660} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0, y: 1} - m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 132, y: -174.5} - m_SizeDelta: {x: 264, y: 349} + 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.5, y: 0.5} --- !u!222 &8646173537325353418 CanvasRenderer: diff --git a/meng_yao/Assets/Resources/Prefabs/MainPanel.prefab b/meng_yao/Assets/Resources/Prefabs/MainPanel.prefab index e9bd895ae..3f50ede61 100644 --- a/meng_yao/Assets/Resources/Prefabs/MainPanel.prefab +++ b/meng_yao/Assets/Resources/Prefabs/MainPanel.prefab @@ -921,7 +921,6 @@ RectTransform: - {fileID: 3011360593165223875} - {fileID: 3011360594467670305} - {fileID: 3011360593094855125} - - {fileID: 3011360594285297421} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -3586,6 +3585,12 @@ MonoBehaviour: m_Script: {fileID: 11500000, guid: a3a6b8473145fbb45ab7cbeccf28286d, type: 3} m_Name: m_EditorClassIdentifier: + btn1: {fileID: 2130962702} + btn2: {fileID: 1703562762} + obj: {fileID: 3011360593039830508} + speed: 8 + textColor1: {r: 0, g: 0, b: 0, a: 1} + textColor2: {r: 1, g: 1, b: 1, a: 1} --- !u!1 &3011360593023613002 GameObject: m_ObjectHideFlags: 0 @@ -5011,8 +5016,9 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 3011360593323557530} + - component: {fileID: 366819988} m_Layer: 5 - m_Name: Strength + m_Name: StaminaBar m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -5042,6 +5048,24 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 120} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &366819988 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3011360593323557531} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: f2d69f2aa3f6373469eb2b4585d59920, type: 3} + m_Name: + m_EditorClassIdentifier: + filled: {fileID: 0} + MaxNumberInt: 0 + numberInt: 0 + TextFilled: {fileID: 0} + Timer: 0 + TextTime: {fileID: 0} --- !u!1 &3011360593356703323 GameObject: m_ObjectHideFlags: 0 @@ -6388,10 +6412,10 @@ MonoBehaviour: m_PersistentCalls: m_Calls: [] m_Sprite: {fileID: 21300000, guid: 63977b6fd70c29d4387087bc3f19c1ed, type: 3} - m_Type: 0 + m_Type: 1 m_PreserveAspect: 0 m_FillCenter: 1 - m_FillMethod: 4 + m_FillMethod: 1 m_FillAmount: 1 m_FillClockwise: 1 m_FillOrigin: 0 @@ -7129,86 +7153,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!1 &3011360593755663291 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3011360593755663290} - - component: {fileID: 3011360593755663288} - - component: {fileID: 3011360593755663289} - m_Layer: 5 - m_Name: Text (Legacy) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &3011360593755663290 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3011360593755663291} - 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: 3011360594285297421} - m_RootOrder: 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 &3011360593755663288 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3011360593755663291} - m_CullTransparentMesh: 1 ---- !u!114 &3011360593755663289 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3011360593755663291} - 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: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 14 - m_FontStyle: 0 - m_BestFit: 0 - m_MinSize: 10 - m_MaxSize: 40 - m_Alignment: 4 - m_AlignByGeometry: 0 - m_RichText: 1 - m_HorizontalOverflow: 0 - m_VerticalOverflow: 0 - m_LineSpacing: 1 - m_Text: Button --- !u!1 &3011360593756524122 GameObject: m_ObjectHideFlags: 0 @@ -10024,128 +9968,6 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 ---- !u!1 &3011360594285297422 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3011360594285297421} - - component: {fileID: 3011360594285297410} - - component: {fileID: 3011360594285297411} - - component: {fileID: 3011360594285297420} - m_Layer: 5 - m_Name: Button (Legacy) - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 0 ---- !u!224 &3011360594285297421 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3011360594285297422} - 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: 3011360593755663290} - m_Father: {fileID: 3011360592396996928} - m_RootOrder: 4 - 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: 160, y: 30} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &3011360594285297410 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3011360594285297422} - m_CullTransparentMesh: 1 ---- !u!114 &3011360594285297411 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3011360594285297422} - 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!114 &3011360594285297420 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3011360594285297422} - 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: 3011360594285297411} - m_OnClick: - m_PersistentCalls: - m_Calls: [] --- !u!1 &3011360594291280544 GameObject: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/script/UI_prefabs/Battle_Selection.cs b/meng_yao/Assets/script/UI_prefabs/Battle_Selection.cs index 07d0da773..de27756e8 100644 --- a/meng_yao/Assets/script/UI_prefabs/Battle_Selection.cs +++ b/meng_yao/Assets/script/UI_prefabs/Battle_Selection.cs @@ -35,6 +35,8 @@ public class Battle_Selection : BaseUI public List