From 012b792ad9dab2eac90a5dbd6e164a95d352e7e9 Mon Sep 17 00:00:00 2001 From: GL <2365963573@qq.com> Date: Wed, 18 Dec 2024 20:44:20 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A3=98=E5=AD=97=E5=B7=A6=E5=8F=B3=E5=8F=98?= =?UTF-8?q?=E5=8C=96=EF=BC=8C=E5=85=94=E5=85=94=E7=8C=AB=E5=8A=A8=E7=94=BB?= =?UTF-8?q?=E7=9F=AB=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Prefabs/charatar/enemy/SnowHpControl.cs | 22 ++- .../Prefabs/charatar/enemy/wood_min.prefab | 12 +- .../charatar/enemy/wood_min/Circle.controller | 33 +++- meng_yao/Assets/Prefabs/charatar/tutu.prefab | 138 ++++++++------- .../animation/A_fightin/Ftest/hxt.png | Bin 0 -> 287 bytes .../animation/A_fightin/Ftest/hxt.png.meta | 135 ++++++++++++++ .../A_fightin/tuziAnimation/Circle.controller | 162 +++++++++++++++++ .../tuziAnimation/Circle.controller.meta | 8 + .../A_fightin/tuziAnimation/tutuAttack.anim | 144 +++++++++++++++ .../tuziAnimation/tutuAttack.anim.meta | 8 + .../A_fightin/tuziAnimation/tutuStand.anim | 164 ++++++++++++++++++ .../tuziAnimation/tutuStand.anim.meta | 8 + meng_yao/Assets/common | 2 +- 13 files changed, 759 insertions(+), 77 deletions(-) create mode 100644 meng_yao/Assets/Resources/animation/A_fightin/Ftest/hxt.png create mode 100644 meng_yao/Assets/Resources/animation/A_fightin/Ftest/hxt.png.meta create mode 100644 meng_yao/Assets/Resources/animation/A_fightin/tuziAnimation/Circle.controller create mode 100644 meng_yao/Assets/Resources/animation/A_fightin/tuziAnimation/Circle.controller.meta create mode 100644 meng_yao/Assets/Resources/animation/A_fightin/tuziAnimation/tutuAttack.anim create mode 100644 meng_yao/Assets/Resources/animation/A_fightin/tuziAnimation/tutuAttack.anim.meta create mode 100644 meng_yao/Assets/Resources/animation/A_fightin/tuziAnimation/tutuStand.anim create mode 100644 meng_yao/Assets/Resources/animation/A_fightin/tuziAnimation/tutuStand.anim.meta diff --git a/meng_yao/Assets/Prefabs/charatar/enemy/SnowHpControl.cs b/meng_yao/Assets/Prefabs/charatar/enemy/SnowHpControl.cs index ca86d13bc..066d7fae1 100644 --- a/meng_yao/Assets/Prefabs/charatar/enemy/SnowHpControl.cs +++ b/meng_yao/Assets/Prefabs/charatar/enemy/SnowHpControl.cs @@ -10,11 +10,16 @@ public class SnowHpControl : MonoBehaviour public float moveDistance = 5f; // 跳跃的水平距离 public float fadeDuration = 0.5f; // 消失时间 public Canvas targetCanvas; // 目标画布,用于确保UI元素在该画布上移动 - + public int direction;//显示方向 private Renderer rend; // 用于获取物体的Renderer来控制透明度 private Vector3 initialPosition; void Start() + { + + } + + public void CreateText() { targetCanvas = transform.parent.GetComponent(); @@ -34,7 +39,16 @@ public class SnowHpControl : MonoBehaviour } // 随机初始化位置(在初始位置附近) - float randomX = Random.Range(moveDistance / 4f, moveDistance); + float randomX; + if (direction == 1) + { + randomX = Random.Range(moveDistance / 4f, moveDistance)+moveDistance/2; + } + else + { + randomX = Random.Range(-moveDistance, -moveDistance / 4f)-moveDistance/2; + } + float randomY = Random.Range(-moveDistance / 4f, 0); // 在Y轴上也加一点随机性 transform.position = initialPosition; @@ -47,7 +61,7 @@ public class SnowHpControl : MonoBehaviour Sequence sequence = DOTween.Sequence(); // 1. 跳跃并逐渐变大 - sequence.Append(transform.DOJump(new Vector3(initialPosition.x + randomX + moveDistance, initialPosition.y+randomY),0.3f,1, 0.5f) + sequence.Append(transform.DOJump(new Vector3(initialPosition.x + randomX, initialPosition.y + randomY), 0.3f, 1, 0.5f) .SetEase(Ease.OutQuad) // 跳跃效果,使用OutQuad让跳跃过程中速度逐渐变慢 ); //sequence.Join(transform.DOMoveY(initialPosition.y -( randomY + moveDistance) / 2f, 0.6f) @@ -61,7 +75,7 @@ public class SnowHpControl : MonoBehaviour sequence.Append(transform.DOScale(Vector3.zero, 0.5f).SetEase(Ease.Linear)); // 缩小效果,模拟消失的感觉 sequence.Append(transform.GetComponent().DOFade(0f, fadeDuration).OnComplete(() => { - + Destroy(gameObject); // 动画完成后销毁对象 })); } diff --git a/meng_yao/Assets/Prefabs/charatar/enemy/wood_min.prefab b/meng_yao/Assets/Prefabs/charatar/enemy/wood_min.prefab index ca2ee744f..6ab1d5489 100644 --- a/meng_yao/Assets/Prefabs/charatar/enemy/wood_min.prefab +++ b/meng_yao/Assets/Prefabs/charatar/enemy/wood_min.prefab @@ -127,8 +127,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 0} m_AnchorMax: {x: 1, y: 1} - m_AnchoredPosition: {x: 5.81, y: 0} - m_SizeDelta: {x: 11.72, y: 0} + m_AnchoredPosition: {x: 0, y: 0} + m_SizeDelta: {x: 0.111134015, y: 0} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &744592432927293251 CanvasRenderer: @@ -151,14 +151,14 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: m_Material: {fileID: 0} - m_Color: {r: 1, g: 1, b: 1, a: 0.5019608} + m_Color: {r: 1, g: 0.89228183, b: 0.39999998, a: 0.5294118} 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: be7cd7587e113e04c886efa8d506cf14, type: 3} + m_Sprite: {fileID: 21300000, guid: ffc69b51517b07c4a96193545b021c8d, type: 3} m_Type: 3 m_PreserveAspect: 0 m_FillCenter: 1 @@ -379,7 +379,7 @@ MonoBehaviour: - {fileID: 21300000, guid: 84ea23eac94f8e84bb75e7c77f95447e, type: 3} - {fileID: 21300000, guid: cab320b3f45281448944a1a9c46cc762, type: 3} - {fileID: 21300000, guid: 1657ff3f38d87b94586a400f5834025c, type: 3} - CharacterAnimationFrameInterval: 36 + CharacterAnimationFrameInterval: 18 - value: - {fileID: 21300000, guid: d0e97f96cf7eb544ab3a5fa66cd90b76, type: 3} - {fileID: 21300000, guid: d5d7283b4ed2eb84d8c769594f12ea17, type: 3} @@ -582,7 +582,7 @@ SpriteRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 - m_Sprite: {fileID: 21300000, guid: 5fdc02cc28955354681ddffb7b09085a, type: 3} + m_Sprite: {fileID: 21300000, guid: 84ea23eac94f8e84bb75e7c77f95447e, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 diff --git a/meng_yao/Assets/Prefabs/charatar/enemy/wood_min/Circle.controller b/meng_yao/Assets/Prefabs/charatar/enemy/wood_min/Circle.controller index 457a42bf2..9e682e0ea 100644 --- a/meng_yao/Assets/Prefabs/charatar/enemy/wood_min/Circle.controller +++ b/meng_yao/Assets/Prefabs/charatar/enemy/wood_min/Circle.controller @@ -1,5 +1,24 @@ %YAML 1.1 %TAG !u! tag:unity3d.com,2011: +--- !u!1107 &-8261493518895400377 +AnimatorStateMachine: + serializedVersion: 6 + m_ObjectHideFlags: 1 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_Name: Base Layer + m_ChildStates: [] + m_ChildStateMachines: [] + m_AnyStateTransitions: [] + m_EntryTransitions: [] + m_StateMachineTransitions: {} + m_StateMachineBehaviours: [] + m_AnyStatePosition: {x: 50, y: 20, z: 0} + m_EntryPosition: {x: 50, y: 120, z: 0} + m_ExitPosition: {x: 800, y: 120, z: 0} + m_ParentStateMachinePosition: {x: 800, y: 20, z: 0} + m_DefaultState: {fileID: 0} --- !u!91 &9100000 AnimatorController: m_ObjectHideFlags: 0 @@ -9,4 +28,16 @@ AnimatorController: m_Name: Circle serializedVersion: 5 m_AnimatorParameters: [] - m_AnimatorLayers: [] + m_AnimatorLayers: + - serializedVersion: 5 + m_Name: Base Layer + m_StateMachine: {fileID: -8261493518895400377} + m_Mask: {fileID: 0} + m_Motions: [] + m_Behaviours: [] + m_BlendingMode: 0 + m_SyncedLayerIndex: -1 + m_DefaultWeight: 0 + m_IKPass: 0 + m_SyncedLayerAffectsTiming: 0 + m_Controller: {fileID: 9100000} diff --git a/meng_yao/Assets/Prefabs/charatar/tutu.prefab b/meng_yao/Assets/Prefabs/charatar/tutu.prefab index 411642007..f04b0c3a6 100644 --- a/meng_yao/Assets/Prefabs/charatar/tutu.prefab +++ b/meng_yao/Assets/Prefabs/charatar/tutu.prefab @@ -73,6 +73,37 @@ MonoBehaviour: m_EditorClassIdentifier: role: {fileID: 8433650274028726420} panelPrefab: {fileID: 8782491854383104488, guid: 61ffa7d22a51b1e48a3495af66e30de0, type: 3} +--- !u!1 &6070656209494785206 +GameObject: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + serializedVersion: 6 + m_Component: + - component: {fileID: 2562350995381512747} + m_Layer: 0 + m_Name: StartPos + m_TagString: Untagged + m_Icon: {fileID: 0} + m_NavMeshLayer: 0 + m_StaticEditorFlags: 0 + m_IsActive: 1 +--- !u!4 &2562350995381512747 +Transform: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 6070656209494785206} + m_LocalRotation: {x: 0, y: 0, z: 0, w: 1} + m_LocalPosition: {x: -0.479, y: 0.817, z: 0} + m_LocalScale: {x: 1, y: 1, z: 1} + m_ConstrainProportionsScale: 0 + m_Children: [] + m_Father: {fileID: 8433650275485930555} + m_RootOrder: 3 + m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} --- !u!1 &8433650274046349753 GameObject: m_ObjectHideFlags: 0 @@ -83,6 +114,8 @@ GameObject: m_Component: - component: {fileID: 8433650274046349754} - component: {fileID: 8433650274046349755} + - component: {fileID: 9037670100243302216} + - component: {fileID: 860192343968067931} m_Layer: 0 m_Name: Circle m_TagString: Untagged @@ -146,7 +179,7 @@ SpriteRenderer: m_SortingLayerID: 0 m_SortingLayer: 0 m_SortingOrder: 0 - m_Sprite: {fileID: 21300000, guid: 214e6e4e1961c1c48b8614047e962e6b, type: 3} + m_Sprite: {fileID: 21300000, guid: 4b41eb7dadefd8949b2fb9b3408ed313, type: 3} m_Color: {r: 1, g: 1, b: 1, a: 1} m_FlipX: 0 m_FlipY: 0 @@ -157,6 +190,40 @@ SpriteRenderer: m_WasSpriteAssigned: 1 m_MaskInteraction: 0 m_SpriteSortPoint: 0 +--- !u!95 &9037670100243302216 +Animator: + serializedVersion: 5 + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8433650274046349753} + m_Enabled: 1 + m_Avatar: {fileID: 0} + m_Controller: {fileID: 9100000, guid: 1e52f8b55fd91f94ca5dcc859e2faa7e, type: 2} + m_CullingMode: 0 + m_UpdateMode: 0 + m_ApplyRootMotion: 0 + m_LinearVelocityBlending: 0 + m_StabilizeFeet: 0 + m_WarningMessage: + m_HasTransformHierarchy: 1 + m_AllowConstantClipSamplingOptimization: 1 + m_KeepAnimatorStateOnDisable: 0 + m_WriteDefaultValuesOnDisable: 0 +--- !u!114 &860192343968067931 +MonoBehaviour: + m_ObjectHideFlags: 0 + m_CorrespondingSourceObject: {fileID: 0} + m_PrefabInstance: {fileID: 0} + m_PrefabAsset: {fileID: 0} + m_GameObject: {fileID: 8433650274046349753} + m_Enabled: 1 + m_EditorHideFlags: 0 + m_Script: {fileID: 11500000, guid: 7d7d3146a1294f044892ae91ba6c7cd6, type: 3} + m_Name: + m_EditorClassIdentifier: + attack: {fileID: 7276635428522831207} --- !u!1 &8433650274814453344 GameObject: m_ObjectHideFlags: 0 @@ -208,9 +275,9 @@ MonoBehaviour: damageTyp: 2 attackCooldown: 1 bulltes: [] - animator: {fileID: 0} + animator: {fileID: 9037670100243302216} fireAni: {fileID: 0} - BulletStartPos: {fileID: 0} + BulletStartPos: {fileID: 2562350995381512747} direction: {x: 0, y: 0} --- !u!58 &1338343970434073545 CircleCollider2D: @@ -263,6 +330,7 @@ Transform: - {fileID: 8433650274814453345} - {fileID: 8433650274046349754} - {fileID: 2780405381636526920} + - {fileID: 2562350995381512747} m_Father: {fileID: 0} m_RootOrder: 0 m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} @@ -304,71 +372,11 @@ MonoBehaviour: physicalArmor: 10 magicArmor: 5 Navigation: {fileID: 0} - AnimationTree: - - value: - - {fileID: 21300000, guid: 7a9ea5910ce547648b91fb17f66423b0, type: 3} - - {fileID: 21300000, guid: 4d963c29e6d03d246bfc81716c85c695, type: 3} - - {fileID: 21300000, guid: 3d9fbac889d5ad5409d8a8bb65c7ba3a, type: 3} - - {fileID: 21300000, guid: f2bf7d1ed23ca8842a32692ae3b5e04d, type: 3} - - {fileID: 21300000, guid: e0e33f77929297d478a8dfa0cd6459dc, type: 3} - - {fileID: 21300000, guid: 0a2d3050b4672614cb15b5ae8111dc00, type: 3} - - {fileID: 21300000, guid: 3944bd14050da4946b4fe3f283c636b5, type: 3} - - {fileID: 21300000, guid: a42bbb04049b44144b89057baa808b07, type: 3} - - {fileID: 21300000, guid: a7b17c91a88493b4fbf3479111ad8529, type: 3} - - {fileID: 21300000, guid: 214e6e4e1961c1c48b8614047e962e6b, type: 3} - - {fileID: 21300000, guid: 91b75ac7cef7fab4691af1f133486d28, type: 3} - - {fileID: 21300000, guid: 3377bd6700dff1f4ebe4454a514d3822, type: 3} - - {fileID: 21300000, guid: d09a76c73317e394ba72ae06615e8d8e, type: 3} - - {fileID: 21300000, guid: 022be9ed82b88ca448e83895645aaf7f, type: 3} - - {fileID: 21300000, guid: 6ba220237d59af346988c1a0ee610e54, type: 3} - - {fileID: 21300000, guid: 528ed6f5efb74ca4bb7d600f57f72431, type: 3} - - {fileID: 21300000, guid: 29915f89081bacc4aaa782696eacb03d, type: 3} - - {fileID: 21300000, guid: 94a05f4a221d2a44489218dbdaefef3d, type: 3} - - {fileID: 21300000, guid: ffb2866f43fa6cb4ca43e8a5d60e1287, type: 3} - - {fileID: 21300000, guid: 99fe2b5de63b7c3459d723663e8c005f, type: 3} - - {fileID: 21300000, guid: 10f4a8c446cc49c4194e42f42cfc2be7, type: 3} - - {fileID: 21300000, guid: c7f9e1c4f70d9144082368f6f4d63848, type: 3} - - {fileID: 21300000, guid: 592bbc50c8a486c4693fb8cf27b29670, type: 3} - - {fileID: 21300000, guid: 869a9492ecc04f64795d4700b2e08183, type: 3} - - {fileID: 21300000, guid: ced9891523af42843b0821b6370c24c5, type: 3} - - {fileID: 21300000, guid: 30f24a49e65cf1e4090e348eda66977d, type: 3} - - {fileID: 21300000, guid: a9f88c6bb2de4cf489245f8e183532cc, type: 3} - - {fileID: 21300000, guid: ebb8f39c7c40b6345bfc40ace0649b44, type: 3} - - {fileID: 21300000, guid: adf29684fc00dd5498af7609d9036470, type: 3} - - {fileID: 21300000, guid: 29b3d4ab5f0a7294b845a60e42fd3289, type: 3} - - {fileID: 21300000, guid: 826586e7feecc1d4bad51475454dd002, type: 3} - - {fileID: 21300000, guid: a48c5c5d2bc1d0d4bb8530f1bffbf00c, type: 3} - CharacterAnimationFrameInterval: 50 - - value: - - {fileID: 21300000, guid: 5065ad587b7ca8e4a82e33c40797e307, type: 3} - - {fileID: 21300000, guid: 7a3a190ce8913cc40a19c276da784c4e, type: 3} - - {fileID: 21300000, guid: b0bbef8c103df11429e8eb9fee7c5f3a, type: 3} - - {fileID: 21300000, guid: dce3028a1e881f64a949b087da35995f, type: 3} - - {fileID: 21300000, guid: 431a64a62dcb4ee4f86a8d44378dc9fe, type: 3} - - {fileID: 21300000, guid: 246c11ed5132c4649b8643231deb6829, type: 3} - - {fileID: 21300000, guid: 567f557f73a5d2d488a6463f6e9813d6, type: 3} - - {fileID: 21300000, guid: c0684f77ee86af7488e2f2094acc1970, type: 3} - - {fileID: 21300000, guid: 39ee156552d65b247beab58a57672cde, type: 3} - - {fileID: 21300000, guid: 89e87207a9a2c6144920c482ff527c55, type: 3} - - {fileID: 21300000, guid: 365237f0b749d0948b1ce7a642b5b622, type: 3} - - {fileID: 21300000, guid: 0888c240589273c42b1f3c50447226eb, type: 3} - - {fileID: 21300000, guid: f9cfc1050580be247ba87ba770ccdf75, type: 3} - - {fileID: 21300000, guid: 4b41eb7dadefd8949b2fb9b3408ed313, type: 3} - - {fileID: 21300000, guid: be0b21d56e75af044aba0864cebdbaa2, type: 3} - - {fileID: 21300000, guid: c916ec9a55e39f54bad7d3279c2ace77, type: 3} - - {fileID: 21300000, guid: 8c3ac93f9484210448ed89847a18facf, type: 3} - - {fileID: 21300000, guid: 1aebb49de6d7b5743a9b09b4b8775c51, type: 3} - - {fileID: 21300000, guid: ae8336216ed56da49a2c57218e5f27ac, type: 3} - - {fileID: 21300000, guid: 8a8eb57cfe13f91448f27c4b6f71165b, type: 3} - - {fileID: 21300000, guid: 03e864cdc0386d94784d1706fb2185e1, type: 3} - - {fileID: 21300000, guid: 34ae2a6dfc5da69418692bb75f621ac3, type: 3} - - {fileID: 21300000, guid: 025e32d6b33a56e4898c1dab011c844a, type: 3} - - {fileID: 21300000, guid: 101d265eefe88004c8b30bae46aaeed9, type: 3} - CharacterAnimationFrameInterval: 50 + AnimationTree: [] animationHighlight: 0 spriteRenderer: {fileID: 8433650274046349755} image: {fileID: 0} - isAnimationPlay: 1 + isAnimationPlay: 0 mycollider: {fileID: 1338343970434073545} attackClass: {fileID: 7276635428522831207} CurrentIndex: 0 diff --git a/meng_yao/Assets/Resources/animation/A_fightin/Ftest/hxt.png b/meng_yao/Assets/Resources/animation/A_fightin/Ftest/hxt.png new file mode 100644 index 0000000000000000000000000000000000000000..88ca301af744867efd374343f72534257ed93a0d GIT binary patch literal 287 zcmV+)0pR|LP)tiq*bCxKwD$yJBjg4iLR36Juu?3viHvMQ8avqy?7TLR zUEasAGgC