This commit is contained in:
wulongxiao 2024-12-29 17:43:23 +08:00
commit ec50762700
8 changed files with 39 additions and 9 deletions

View File

@ -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

View File

@ -19,7 +19,7 @@ public class SnowHpControl : MonoBehaviour
}
public void CreateText()
public void CreateText(bool isGoodDamege=false)
{
targetCanvas = transform.parent.GetComponent<Canvas>();
@ -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让物体变大时有一个“弹跳”的效果
);

View File

@ -330,7 +330,7 @@ MonoBehaviour:
id: 0
Name:
camp: 1
hp: 50
hp: 25
dieIndex: 1
Hpfiil: {fileID: 1566038940701374259}
HpfiilYello: {fileID: 605146830908541898}

View File

@ -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

View File

@ -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

View File

@ -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

@ -1 +1 @@
Subproject commit bf88fb96a3125ef91388146665eeab8f80aa2f25
Subproject commit 44483bcb6a3dcf7477cf902b1afb616b65111a9a

View File

@ -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();