diff --git a/meng_yao/Assets/Prefabs/charatar/enemy/SnowHp.prefab b/meng_yao/Assets/Prefabs/charatar/enemy/SnowHp.prefab index 9b2c0006..be52f72a 100644 --- a/meng_yao/Assets/Prefabs/charatar/enemy/SnowHp.prefab +++ b/meng_yao/Assets/Prefabs/charatar/enemy/SnowHp.prefab @@ -80,7 +80,7 @@ MonoBehaviour: m_HorizontalOverflow: 1 m_VerticalOverflow: 1 m_LineSpacing: 1 - m_Text: 100 + m_Text: "\U0001F4A5\U0001F525100" --- !u!114 &7426565245524278981 MonoBehaviour: m_ObjectHideFlags: 0 @@ -96,7 +96,7 @@ MonoBehaviour: minScale: {x: 2, y: 2, z: 2} maxScale: {x: 2.5, y: 2.5, z: 2.5} duration: 0.5 - moveSpeed: 0.5 - fadeDuration: 0 moveDistance: 1 + fadeDuration: 0 targetCanvas: {fileID: 0} + direction: 0 diff --git a/meng_yao/Assets/Prefabs/charatar/enemy/SnowHpControl.cs b/meng_yao/Assets/Prefabs/charatar/enemy/SnowHpControl.cs index f2d46df3..de5a3e5f 100644 --- a/meng_yao/Assets/Prefabs/charatar/enemy/SnowHpControl.cs +++ b/meng_yao/Assets/Prefabs/charatar/enemy/SnowHpControl.cs @@ -19,7 +19,7 @@ public class SnowHpControl : MonoBehaviour } - public void CreateText() + public void CreateText(bool isGoodDamege=false) { targetCanvas = transform.parent.GetComponent(); @@ -57,6 +57,9 @@ public class SnowHpControl : MonoBehaviour float randomScaleY = Random.Range(minScale.y, maxScale.y); transform.localScale = new Vector3(randomScaleX, randomScaleY, 1f); + // 如果是暴击,增加物体的初始大小 + Vector3 finalScale = isGoodDamege ? maxScale * 2f : maxScale; // 如果是暴击,放大1.5倍 + // 使用DOTween做跳跃动画 Sequence sequence = DOTween.Sequence(); @@ -67,7 +70,8 @@ public class SnowHpControl : MonoBehaviour //sequence.Join(transform.DOMoveY(initialPosition.y -( randomY + moveDistance) / 2f, 0.6f) // .SetEase(Ease.OutQuad) // 跳跃的高度,跟X轴的跳跃配合 //); - sequence.Join(transform.DOScale(maxScale, 0.5f) // 同时控制大小,从初始值到最大值 + + sequence.Join(transform.DOScale(finalScale, 0.5f) // 同时控制大小,从初始值到最大值 .SetEase(Ease.OutBack) // 使用OutBack让物体变大时有一个“弹跳”的效果 ); diff --git a/meng_yao/Assets/Prefabs/charatar/enemy/wood_min.prefab b/meng_yao/Assets/Prefabs/charatar/enemy/wood_min.prefab index 1bca11aa..cecae3ef 100644 --- a/meng_yao/Assets/Prefabs/charatar/enemy/wood_min.prefab +++ b/meng_yao/Assets/Prefabs/charatar/enemy/wood_min.prefab @@ -330,7 +330,7 @@ MonoBehaviour: id: 0 Name: camp: 1 - hp: 50 + hp: 25 dieIndex: 1 Hpfiil: {fileID: 1566038940701374259} HpfiilYello: {fileID: 605146830908541898} diff --git a/meng_yao/Assets/Prefabs/charatar/laohu.prefab b/meng_yao/Assets/Prefabs/charatar/laohu.prefab index 79601809..287e5fa0 100644 --- a/meng_yao/Assets/Prefabs/charatar/laohu.prefab +++ b/meng_yao/Assets/Prefabs/charatar/laohu.prefab @@ -500,6 +500,7 @@ MonoBehaviour: gold: 10 MaxAttack: 5 MinAttack: 4 + isGoodDamege: 0 physicalArmor: 10 magicArmor: 5 Navigation: {fileID: 0} @@ -525,6 +526,12 @@ MonoBehaviour: - {fileID: 21300000, guid: fdd1af82c4a2e3b43adb1ef595ec34d0, type: 3} - {fileID: 21300000, guid: 4043457f6fd1cda4eb486839f31d2806, type: 3} harmNumber: 0 + Defense: 0 + DamageToPlayer: 0 + HealthPerLevel: 0 + DefensePerLevel: 0 + elementType: 3 + defenseType: 0 --- !u!61 &-3836672401185760439 BoxCollider2D: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/Prefabs/charatar/mkl.prefab b/meng_yao/Assets/Prefabs/charatar/mkl.prefab index 6e6ebd4a..32cbb4dd 100644 --- a/meng_yao/Assets/Prefabs/charatar/mkl.prefab +++ b/meng_yao/Assets/Prefabs/charatar/mkl.prefab @@ -161,7 +161,10 @@ MonoBehaviour: isShowPanel: 0 instantiatedPanel: {fileID: 0} OrigScale: {x: 0, y: 0, z: 0} + StartSizeX: 0 + StartSizeY: 0 OrSizeX: 0 + OrSizeY: 0 --- !u!1 &6070656209494785206 GameObject: m_ObjectHideFlags: 0 @@ -486,6 +489,7 @@ MonoBehaviour: gold: 10 MaxAttack: 6 MinAttack: 4 + isGoodDamege: 0 physicalArmor: 10 magicArmor: 5 Navigation: {fileID: 0} @@ -511,6 +515,12 @@ MonoBehaviour: - {fileID: 21300000, guid: 0adb087419dd674498495bad0175fc85, type: 3} - {fileID: 21300000, guid: d899198e4c5678843aa5f2143bbc226f, type: 3} harmNumber: 0 + Defense: 0 + DamageToPlayer: 0 + HealthPerLevel: 0 + DefensePerLevel: 0 + elementType: 1 + defenseType: 0 --- !u!61 &-3836672401185760439 BoxCollider2D: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/Prefabs/charatar/qi_e.prefab b/meng_yao/Assets/Prefabs/charatar/qi_e.prefab index 7b730575..b9e8cf9b 100644 --- a/meng_yao/Assets/Prefabs/charatar/qi_e.prefab +++ b/meng_yao/Assets/Prefabs/charatar/qi_e.prefab @@ -77,7 +77,10 @@ MonoBehaviour: isShowPanel: 0 instantiatedPanel: {fileID: 0} OrigScale: {x: 0, y: 0, z: 0} + StartSizeX: 0 + StartSizeY: 0 OrSizeX: 0 + OrSizeY: 0 --- !u!1 &3418438549176293054 GameObject: m_ObjectHideFlags: 0 @@ -486,6 +489,7 @@ MonoBehaviour: gold: 10 MaxAttack: 10 MinAttack: 7 + isGoodDamege: 0 physicalArmor: 10 magicArmor: 5 Navigation: {fileID: 0} @@ -511,6 +515,12 @@ MonoBehaviour: - {fileID: 21300000, guid: cfd21a22d56637e44b11ed37c12db481, type: 3} - {fileID: 21300000, guid: 1ccc75d4e69b889498b2e30ca0e77bb1, type: 3} harmNumber: 0 + Defense: 0 + DamageToPlayer: 0 + HealthPerLevel: 0 + DefensePerLevel: 0 + elementType: 2 + defenseType: 0 --- !u!61 &-3836672401185760439 BoxCollider2D: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/Resources/Prefabs/MainPanel.prefab b/meng_yao/Assets/Resources/Prefabs/MainPanel.prefab index 6da5cbb4..539cd161 100644 --- a/meng_yao/Assets/Resources/Prefabs/MainPanel.prefab +++ b/meng_yao/Assets/Resources/Prefabs/MainPanel.prefab @@ -526,6 +526,151 @@ RectTransform: m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} +--- !u!1 &617219116198635587 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2372872097891136782} + - component: {fileID: 5930888730339565146} + - component: {fileID: 6299092088638637511} + - component: {fileID: 5283151450563293758} + - component: {fileID: 6421841758342192495} + - component: {fileID: 5840664033343851766} + m_Layer: 5 + m_Name: CheckpointsBox + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &2372872097891136782 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617219116198635587} + 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: 6335397886766934478} + m_Father: {fileID: 3011360593928271564} + m_RootOrder: 1 + 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: 1.1064, y: 204.69653} + m_SizeDelta: {x: 600, y: 750} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &5930888730339565146 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617219116198635587} + m_CullTransparentMesh: 1 +--- !u!114 &6299092088638637511 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617219116198635587} + 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: 0} + 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!114 &5283151450563293758 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617219116198635587} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 1aa08ab6e0800fa44ae55d278d1423e3, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Content: {fileID: 3215173789656602693} + m_Horizontal: 1 + m_Vertical: 0 + m_MovementType: 1 + m_Elasticity: 0.1 + m_Inertia: 1 + m_DecelerationRate: 0.135 + m_ScrollSensitivity: 1 + m_Viewport: {fileID: 6335397886766934478} + m_HorizontalScrollbar: {fileID: 0} + m_VerticalScrollbar: {fileID: 0} + m_HorizontalScrollbarVisibility: 2 + m_VerticalScrollbarVisibility: 2 + m_HorizontalScrollbarSpacing: -3 + m_VerticalScrollbarSpacing: -3 + m_OnValueChanged: + m_PersistentCalls: + m_Calls: [] +--- !u!114 &6421841758342192495 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617219116198635587} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: 600 + m_MinHeight: 750 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 +--- !u!114 &5840664033343851766 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 617219116198635587} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 36a154c6ab438304392f989d2d6ee437, type: 3} + m_Name: + m_EditorClassIdentifier: + _modePanel: {fileID: 1310652693} + _text: {fileID: 3011360593470444517} + OBJ: {fileID: 617219116198635587} --- !u!1 &1572365498857213021 GameObject: m_ObjectHideFlags: 0 @@ -1307,9 +1452,9 @@ RectTransform: m_Father: {fileID: 3011360593094855125} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} - m_AnchorMin: {x: 0.5, y: 0} - m_AnchorMax: {x: 0.5, y: 0} - m_AnchoredPosition: {x: 0, y: 314.8496} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: 0, y: 68} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!114 &1104162584 @@ -2920,82 +3065,6 @@ MonoBehaviour: m_ChildScaleWidth: 0 m_ChildScaleHeight: 0 m_ReverseArrangement: 0 ---- !u!1 &3011360592845398327 -GameObject: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - serializedVersion: 6 - m_Component: - - component: {fileID: 3011360592845398326} - - component: {fileID: 3011360592845398324} - - component: {fileID: 3011360592845398325} - m_Layer: 5 - m_Name: PreBtn - m_TagString: Untagged - m_Icon: {fileID: 0} - m_NavMeshLayer: 0 - m_StaticEditorFlags: 0 - m_IsActive: 1 ---- !u!224 &3011360592845398326 -RectTransform: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3011360592845398327} - m_LocalRotation: {x: 0, y: 1, z: 0, w: 0} - m_LocalPosition: {x: 0, y: 0, z: 0} - m_LocalScale: {x: 1, y: 1, z: 1} - m_ConstrainProportionsScale: 0 - m_Children: [] - m_Father: {fileID: 3011360593414553575} - m_RootOrder: 0 - m_LocalEulerAnglesHint: {x: 0, y: 180, z: 0} - m_AnchorMin: {x: 0.5, y: 0.5} - m_AnchorMax: {x: 0.5, y: 0.5} - m_AnchoredPosition: {x: -453, y: 0} - m_SizeDelta: {x: 70, y: 112} - m_Pivot: {x: 0.5, y: 0.5} ---- !u!222 &3011360592845398324 -CanvasRenderer: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3011360592845398327} - m_CullTransparentMesh: 1 ---- !u!114 &3011360592845398325 -MonoBehaviour: - m_ObjectHideFlags: 0 - m_CorrespondingSourceObject: {fileID: 0} - m_PrefabInstance: {fileID: 0} - m_PrefabAsset: {fileID: 0} - m_GameObject: {fileID: 3011360592845398327} - 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: e9755c72ac888404681bff08b8fd53d7, type: 3} - m_Type: 0 - m_PreserveAspect: 1 - m_FillCenter: 1 - m_FillMethod: 4 - m_FillAmount: 1 - m_FillClockwise: 1 - m_FillOrigin: 0 - m_UseSpriteMesh: 0 - m_PixelsPerUnitMultiplier: 1 --- !u!1 &3011360592853690226 GameObject: m_ObjectHideFlags: 0 @@ -4594,7 +4663,7 @@ MonoBehaviour: m_PreserveAspect: 0 m_FillCenter: 1 m_FillMethod: 0 - m_FillAmount: 0.291 + m_FillAmount: 0 m_FillClockwise: 1 m_FillOrigin: 0 m_UseSpriteMesh: 0 @@ -5230,6 +5299,7 @@ GameObject: - component: {fileID: 3011360593396850339} - component: {fileID: 3011360593396850337} - component: {fileID: 3011360593396850338} + - component: {fileID: 6625591618710717944} m_Layer: 5 m_Name: NextBtn m_TagString: Untagged @@ -5295,6 +5365,50 @@ MonoBehaviour: m_FillOrigin: 0 m_UseSpriteMesh: 0 m_PixelsPerUnitMultiplier: 1 +--- !u!114 &6625591618710717944 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3011360593396850348} + 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: 3011360593396850338} + m_OnClick: + m_PersistentCalls: + m_Calls: [] --- !u!1 &3011360593399644009 GameObject: m_ObjectHideFlags: 0 @@ -5399,7 +5513,7 @@ RectTransform: m_LocalScale: {x: 1, y: 1, z: 1} m_ConstrainProportionsScale: 0 m_Children: - - {fileID: 3011360592845398326} + - {fileID: 5965806449581216869} - {fileID: 3011360593845604471} - {fileID: 3011360593396850339} m_Father: {fileID: 3011360593841887782} @@ -5598,8 +5712,8 @@ RectTransform: 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: 4.0702} - m_SizeDelta: {x: 464, y: 77.8596} + m_AnchoredPosition: {x: -1.9946, y: 4.0702} + m_SizeDelta: {x: 328.3699, y: 77.8596} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &3011360593470444516 CanvasRenderer: @@ -5631,9 +5745,9 @@ MonoBehaviour: m_Calls: [] m_FontData: m_Font: {fileID: 10102, guid: 0000000000000000e000000000000000, type: 0} - m_FontSize: 56 + m_FontSize: 50 m_FontStyle: 0 - m_BestFit: 0 + m_BestFit: 1 m_MinSize: 0 m_MaxSize: 77 m_Alignment: 4 @@ -6852,8 +6966,9 @@ GameObject: serializedVersion: 6 m_Component: - component: {fileID: 3011360593699687250} + - component: {fileID: 901532650777563773} m_Layer: 5 - m_Name: TipMid + m_Name: guanqia m_TagString: Untagged m_Icon: {fileID: 0} m_NavMeshLayer: 0 @@ -6873,14 +6988,34 @@ RectTransform: m_Children: - {fileID: 3011360593362587367} - {fileID: 3011360594259349989} - m_Father: {fileID: 3011360593928271564} - m_RootOrder: 1 + m_Father: {fileID: 3215173789656602693} + 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: 50, y: -470} - m_SizeDelta: {x: 100, y: 100} + m_AnchoredPosition: {x: 300, y: -366.5} + m_SizeDelta: {x: 600, y: 733} m_Pivot: {x: 0.5, y: 0.5} +--- !u!114 &901532650777563773 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 3011360593699687251} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 306cc8c2b49d7114eaa3623786fc2126, type: 3} + m_Name: + m_EditorClassIdentifier: + m_IgnoreLayout: 0 + m_MinWidth: 600 + m_MinHeight: 733 + m_PreferredWidth: -1 + m_PreferredHeight: -1 + m_FlexibleWidth: -1 + m_FlexibleHeight: -1 + m_LayoutPriority: 1 --- !u!1 &3011360593729086423 GameObject: m_ObjectHideFlags: 0 @@ -8013,7 +8148,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 50, y: -870} + m_AnchoredPosition: {x: 50, y: -294} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &3011360593866302987 @@ -8350,14 +8485,14 @@ RectTransform: m_ConstrainProportionsScale: 0 m_Children: - {fileID: 3011360594066592782} - - {fileID: 3011360593699687250} + - {fileID: 2372872097891136782} - {fileID: 3011360593852809512} m_Father: {fileID: 3011360593841887782} m_RootOrder: 1 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: 593} + m_AnchoredPosition: {x: 0, y: 0} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &3011360593930044813 @@ -8937,7 +9072,7 @@ RectTransform: m_PrefabInstance: {fileID: 0} m_PrefabAsset: {fileID: 0} m_GameObject: {fileID: 3011360594066592783} - m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + 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 @@ -8949,7 +9084,7 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 50, y: -50} + m_AnchoredPosition: {x: 50, y: 567} m_SizeDelta: {x: 100, y: 100} m_Pivot: {x: 0.5, y: 0.5} --- !u!1 &3011360594066920931 @@ -10857,6 +10992,97 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: [] +--- !u!1 &4681035672399457600 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 6335397886766934478} + - component: {fileID: 3750459843292451767} + - component: {fileID: 5108424620838132395} + - component: {fileID: 5785555120566224879} + m_Layer: 5 + m_Name: Viewport + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &6335397886766934478 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4681035672399457600} + 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: 3215173789656602693} + m_Father: {fileID: 2372872097891136782} + 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: -17} + m_Pivot: {x: 0, y: 1} +--- !u!222 &3750459843292451767 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4681035672399457600} + m_CullTransparentMesh: 1 +--- !u!114 &5108424620838132395 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4681035672399457600} + 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: 10917, 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 &5785555120566224879 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 4681035672399457600} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 31a19414c41e5ae4aae2af33fee712f6, type: 3} + m_Name: + m_EditorClassIdentifier: + m_ShowMaskGraphic: 0 --- !u!1 &4819045892542064047 GameObject: m_ObjectHideFlags: 0 @@ -10990,6 +11216,127 @@ MonoBehaviour: m_StringArgument: m_BoolArgument: 1 m_CallState: 2 +--- !u!1 &6470131274562747472 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 5965806449581216869} + - component: {fileID: 2265964094398036564} + - component: {fileID: 2073586666049410327} + - component: {fileID: 3292575221714447488} + m_Layer: 5 + m_Name: PreBtn + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &5965806449581216869 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6470131274562747472} + m_LocalRotation: {x: 0, y: 0, z: 1, w: 0} + m_LocalPosition: {x: 0, y: 0, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 3011360593414553575} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 180} + m_AnchorMin: {x: 0.5, y: 0.5} + m_AnchorMax: {x: 0.5, y: 0.5} + m_AnchoredPosition: {x: -460, y: 0} + m_SizeDelta: {x: 70, y: 112} + m_Pivot: {x: 0.5, y: 0.5} +--- !u!222 &2265964094398036564 +CanvasRenderer: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6470131274562747472} + m_CullTransparentMesh: 1 +--- !u!114 &2073586666049410327 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6470131274562747472} + 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: e9755c72ac888404681bff08b8fd53d7, type: 3} + m_Type: 0 + m_PreserveAspect: 1 + m_FillCenter: 1 + m_FillMethod: 4 + m_FillAmount: 1 + m_FillClockwise: 1 + m_FillOrigin: 0 + m_UseSpriteMesh: 0 + m_PixelsPerUnitMultiplier: 1 +--- !u!114 &3292575221714447488 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6470131274562747472} + 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: 2073586666049410327} + m_OnClick: + m_PersistentCalls: + m_Calls: [] --- !u!1 &6809650755665793444 GameObject: m_ObjectHideFlags: 0 @@ -11244,6 +11591,83 @@ MonoBehaviour: m_OnClick: m_PersistentCalls: m_Calls: [] +--- !u!1 &9036433839497035382 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 3215173789656602693} + - component: {fileID: 8566176095083144866} + - component: {fileID: 2879485673068052520} + m_Layer: 5 + m_Name: Content + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!224 &3215173789656602693 +RectTransform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9036433839497035382} + 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: 3011360593699687250} + m_Father: {fileID: 6335397886766934478} + m_RootOrder: 0 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} + m_AnchorMin: {x: 0, y: 1} + m_AnchorMax: {x: 1, y: 1} + m_AnchoredPosition: {x: -0.0004750166, y: 0} + m_SizeDelta: {x: 0, y: 0} + m_Pivot: {x: 0, y: 1} +--- !u!114 &8566176095083144866 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9036433839497035382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 8a8695521f0d02e499659fee002a26c2, type: 3} + m_Name: + m_EditorClassIdentifier: + m_Padding: + m_Left: 0 + m_Right: 0 + m_Top: 0 + m_Bottom: 0 + m_ChildAlignment: 0 + m_StartCorner: 0 + m_StartAxis: 1 + m_CellSize: {x: 600, y: 733} + m_Spacing: {x: 0, y: 0} + m_Constraint: 2 + m_ConstraintCount: 1 +--- !u!114 &2879485673068052520 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 9036433839497035382} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 3245ec927659c4140ac4f8d17403cc18, type: 3} + m_Name: + m_EditorClassIdentifier: + m_HorizontalFit: 2 + m_VerticalFit: 2 --- !u!1001 &2540612749768456658 PrefabInstance: m_ObjectHideFlags: 0 diff --git a/meng_yao/Assets/Scenes/scene_Main.unity b/meng_yao/Assets/Scenes/scene_Main.unity index 5356e413..d8df8ca8 100644 --- a/meng_yao/Assets/Scenes/scene_Main.unity +++ b/meng_yao/Assets/Scenes/scene_Main.unity @@ -30984,6 +30984,10 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 362676243581000638, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} + propertyPath: m_AnchoredPosition.y + value: 0.00003915486 + objectReference: {fileID: 0} - target: {fileID: 1745005861961296864, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -31080,6 +31084,18 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 2562232161644998510, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2562232161644998510, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 2562232161644998510, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} + propertyPath: m_AnchorMin.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 3011360592396996928, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} propertyPath: m_Pivot.x value: 0.5 @@ -31504,6 +31520,10 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 3011360593699687250, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} + propertyPath: m_RootOrder + value: 1 + objectReference: {fileID: 0} - target: {fileID: 3011360593759919820, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -31536,6 +31556,10 @@ PrefabInstance: propertyPath: m_AnchoredPosition.y value: 0 objectReference: {fileID: 0} + - target: {fileID: 3011360593852809512, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} + propertyPath: m_RootOrder + value: 2 + objectReference: {fileID: 0} - target: {fileID: 3011360593911696199, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} propertyPath: m_AnchorMax.y value: 0 @@ -31720,10 +31744,22 @@ PrefabInstance: propertyPath: mygameObject value: objectReference: {fileID: 1553952863} + - target: {fileID: 6366530553166775013, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} + propertyPath: m_AnchorMax.x + value: 0 + objectReference: {fileID: 0} + - target: {fileID: 6366530553166775013, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} + propertyPath: m_AnchorMax.y + value: 0 + objectReference: {fileID: 0} - target: {fileID: 7017397590614610888, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} propertyPath: m_OnClick.m_PersistentCalls.m_Calls.Array.data[0].m_Target value: objectReference: {fileID: 346722530} + - target: {fileID: 8050182666048453755, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} + propertyPath: m_RootOrder + value: 4 + objectReference: {fileID: 0} m_RemovedComponents: [] m_SourcePrefab: {fileID: 100100000, guid: a8cc81ed2c5736a46a14628d8d489ac4, type: 3} --- !u!224 &366820005 stripped diff --git a/meng_yao/Assets/common b/meng_yao/Assets/common index bf88fb96..44483bcb 160000 --- a/meng_yao/Assets/common +++ b/meng_yao/Assets/common @@ -1 +1 @@ -Subproject commit bf88fb96a3125ef91388146665eeab8f80aa2f25 +Subproject commit 44483bcb6a3dcf7477cf902b1afb616b65111a9a diff --git a/meng_yao/Assets/script/A_Fight/enemy.cs b/meng_yao/Assets/script/A_Fight/enemy.cs index a7910b05..81d94dc9 100644 --- a/meng_yao/Assets/script/A_Fight/enemy.cs +++ b/meng_yao/Assets/script/A_Fight/enemy.cs @@ -72,8 +72,7 @@ public class enemy : Role [Header("每级提升防御力")] public float DefensePerLevel; [Header("五行类型")] public ElementType elementType; [Header("防御类型")] public DefenseType defenseType; - [Header("所属空地类型")] public UnitType unitType; - [Header("身形大小")] public Size size; + public override void Start() { base.Start(); diff --git a/meng_yao/Assets/script/scene_Main/ui/CheckpointsBox.cs b/meng_yao/Assets/script/scene_Main/ui/CheckpointsBox.cs new file mode 100644 index 00000000..b15a5f8e --- /dev/null +++ b/meng_yao/Assets/script/scene_Main/ui/CheckpointsBox.cs @@ -0,0 +1,89 @@ +using DG.Tweening; +using System.Threading.Tasks; +using UnityEngine; +using UnityEngine.UI; + +public class CheckpointsBox : MonoBehaviour +{ + [Header("模式切换脚步")] public ModePanel _modePanel; + [Header("文字显示")] public Text _text; + + [Header("旋转物品")] public GameObject OBJ; + + private string temp; + + // Start is called before the first frame update + void Start() + { + temp = _text.text; + + _modePanel.mode1 += async () => + { + _text.text = ""; + await RotationObj(OBJ); + await TypeWriterEffect(temp); + }; + + _modePanel.mode2 += async () => + { + _text.text = ""; + await RotationObj(OBJ); + await TypeWriterEffect(temp + "(精英)"); + }; + } + + // 让物体随机旋转,然后恢复到原来的位置 + public async Task RotationObj(GameObject obj) + { + // 获取当前物体的旋转角度 + Vector3 startRotation = obj.transform.rotation.eulerAngles; + + // 随机生成一个旋转角度 + float randomRotationY = Random.Range(-180f, 180f); + + // 如果旋转角度的绝对值小于 60,则强制设定为 60(可以是正负60) + if (Mathf.Abs(randomRotationY) < 120f) + { + randomRotationY = randomRotationY < 0 ? -120f : 120f; + } + + // 使用 DOTween 来旋转物体,旋转到随机角度 + await AnimateRotation(obj, randomRotationY); + + // 动画完成后,旋转回 Y=0 的角度 + await AnimateRotation(obj, 0f); + } + + // 使用 TaskCompletionSource 来等待 DOTween 动画完成 + private async Task AnimateRotation(GameObject obj, float targetYRotation) + { + // 获取当前物体的旋转角度 + Vector3 startRotation = obj.transform.rotation.eulerAngles; + + // 创建一个 TaskCompletionSource 来等待 DOTween 动画完成 + var tcs = new TaskCompletionSource(); + + // 使用 DOTween 来旋转物体 + obj.transform.DORotate(new Vector3(startRotation.x, targetYRotation, startRotation.z), 1f, RotateMode.FastBeyond360) + .OnComplete(() => + { + // 动画完成后标记 Task 为完成 + tcs.SetResult(true); + }); + + // 等待 Task 完成 + await tcs.Task; + } + + // 打字机效果 + private async Task TypeWriterEffect(string text) + { + _text.text = ""; + foreach (char c in text) + { + _text.text += c; + await Task.Delay(100); // 每个字符之间延迟100毫秒 + } + } + +} diff --git a/meng_yao/Assets/script/scene_Main/ui/CheckpointsBox.cs.meta b/meng_yao/Assets/script/scene_Main/ui/CheckpointsBox.cs.meta new file mode 100644 index 00000000..08ce8fc1 --- /dev/null +++ b/meng_yao/Assets/script/scene_Main/ui/CheckpointsBox.cs.meta @@ -0,0 +1,11 @@ +fileFormatVersion: 2 +guid: 36a154c6ab438304392f989d2d6ee437 +MonoImporter: + externalObjects: {} + serializedVersion: 2 + defaultReferences: [] + executionOrder: 0 + icon: {instanceID: 0} + userData: + assetBundleName: + assetBundleVariant: diff --git a/meng_yao/Assets/script/scene_Main/ui/ModePanel.cs b/meng_yao/Assets/script/scene_Main/ui/ModePanel.cs index 285e6b3e..a030c877 100644 --- a/meng_yao/Assets/script/scene_Main/ui/ModePanel.cs +++ b/meng_yao/Assets/script/scene_Main/ui/ModePanel.cs @@ -2,11 +2,14 @@ using System.Threading.Tasks; using UnityEngine; using UnityEngine.UI; using DG.Tweening; +using static TreeEditor.TreeEditorHelper; public class ModePanel : MonoBehaviour { + + [Header("模式一按钮")] public Button btn1; [Header("模式二按钮")] public Button btn2; @@ -16,16 +19,24 @@ public class ModePanel : MonoBehaviour public Color textColor1; public Color textColor2; + + public delegate void ModeChangeAction(); + + public event ModeChangeAction mode1; + public event ModeChangeAction mode2; + // Start is called before the first frame update void Start() { btn1.onClick.AddListener(() => { + mode1?.Invoke(); MoveToTarget(obj, btn1.GetComponent().position, speed * 100, btn2, btn1); }); btn2.onClick.AddListener(() => { + mode2?.Invoke(); MoveToTarget(obj, btn2.GetComponent().position, speed * 100, btn1, btn2); }); }