✨Added damage fly number
This commit is contained in:
@@ -19,7 +19,11 @@ public partial class FighterVisual : Node2D
|
||||
[ExportCategory("References")]
|
||||
[Export] private Node2D _visualParent = null!;
|
||||
[Export] private Node2D _targetSelectionParent = null!;
|
||||
[Export] private Node2D _squashParent = null!;
|
||||
[Export] public FighterHealthBarVisual healthBarVisual = null!;
|
||||
[Export] private FighterDamageIndicatorVisual _fighterDamageIndicatorVisual;
|
||||
|
||||
|
||||
|
||||
|
||||
private FightWorld.Fighter _boundFighter;
|
||||
@@ -75,8 +79,8 @@ public partial class FighterVisual : Node2D
|
||||
public async Task AnimateHit()
|
||||
{
|
||||
var tween = GetTree().CreateTween();
|
||||
tween.TweenProperty(this, "scale", new Vector2(1.4f, 0.6f), 0.15);
|
||||
tween.TweenProperty(this, "scale", new Vector2(1, 1), 0.4)
|
||||
tween.TweenProperty(_squashParent, "scale", new Vector2(1.4f, 0.6f), 0.15);
|
||||
tween.TweenProperty(_squashParent, "scale", new Vector2(1, 1), 0.4)
|
||||
.SetTrans(Tween.TransitionType.Cubic).SetEase(Tween.EaseType.Out);
|
||||
await ToSignal(tween, "finished");
|
||||
}
|
||||
@@ -90,4 +94,8 @@ public partial class FighterVisual : Node2D
|
||||
// tween.TweenProperty(this, "scale", new Vector2(1, 1), 0.4)
|
||||
// .SetTrans(Tween.TransitionType.Cubic).SetEase(Tween.EaseType.Out);
|
||||
//}
|
||||
public void SpawnDamageIndicatorNumber(int number)
|
||||
{
|
||||
_fighterDamageIndicatorVisual.SpawnFlyingNumber(number);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user