【战斗】==========人物受击后立绘变红

wangzhenxing 2022-11-16 13:31:13 +08:00
parent 155f83671d
commit 51c7375d65
2 changed files with 11 additions and 10 deletions

View File

@ -585,12 +585,13 @@ function EnemyView:DOHitEffect(time, func)
if not time or time < 0.3 then
time = 0.3
end
if self.currAniName~="idle" and self.currAniName~="hit" then
if self.currAniName=="hit" then
-- 受击放大1.2倍
self:DoScale(1.2, 0.1)
self:DoScale(1.2, 0.2)
-- 卡面变红
self.RoleLiveGOGraphic:DOColor(Color.New(1,0,0,1), 0.1):OnComplete(function ()
self.RoleLiveGOGraphic:DOColor(Color.New(1,1,1,1), 0.1):SetDelay(time)
self.RoleLiveGOGraphic:DOColor(Color.New(1,0,0,1), 0.3):OnComplete(function ()
self.RoleLiveGOGraphic:DOColor(Color.New(1,1,1,1), 0.3):SetDelay(time)
end)
-- 震动
self.RoleLiveGOTran:DOShakeAnchorPos(time, Vector2.New(200, 100), 100, 50, false, true):OnComplete(function ()

View File

@ -660,22 +660,22 @@ function PlayerView:DOHitEffect(time, func)
if not time or time < 0.3 then
time = 0.3
end
if self.currAniName~="idle" and self.currAniName~="hit" then
if self.currAniName=="hit" then
-- 受击放大1.2倍
self:DoScale(1.2, 0.1)
self:DoScale(1.2, 0.2)
-- 卡面变红
DoTween.To(DG.Tweening.Core.DOGetter_float( function () return 1 end),
DG.Tweening.Core.DOSetter_float(function (progress)
local color = Color.New(1, progress, progress, 1)
Util.SetColor(self.GameObject, color)
-- Util.SetColor(self.GameObject, color)
Util.SetColor(self.RoleLiveGOGraphic, color)
end), 0, 0.1):SetEase(Ease.Linear):OnComplete(function()
end), 0, 0.3):SetEase(Ease.Linear):OnComplete(function()
DoTween.To(DG.Tweening.Core.DOGetter_float( function () return 0 end),
DG.Tweening.Core.DOSetter_float(function (progress)
local color = Color.New(1, progress, progress, 1)
Util.SetColor(self.GameObject, color)
-- Util.SetColor(self.GameObject, color)
Util.SetColor(self.RoleLiveGOGraphic, color)
end), 1, 0.1):SetEase(Ease.Linear):SetDelay(time)
end), 1, 0.3):SetEase(Ease.Linear):SetDelay(time)
end)
-- 震动
self.RoleLiveGOTran:DOShakeAnchorPos(time, Vector2.New(200, 100), 100, 50, false, true):OnComplete(function ()