This commit is contained in:
DESKTOP-SAJ6RKV\Administrator 2025-05-29 16:32:11 +08:00
parent 08db2b78ad
commit fd2370a143
3 changed files with 16 additions and 11 deletions

View File

@ -289,34 +289,39 @@ namespace GameLogic
actorHItem.transform.DOLocalMoveX(0, 4f).OnComplete(async () =>
{
// 显示一下脑袋
m_rectNao.GetComponent<Image>().material.SetFloat("_Alpha", 1);
//m_rectNao.GetComponent<Image>().material.SetFloat("_Alpha", 1);
// 显示一下脑袋
var naoMat = m_rectNao.GetComponent<Image>().material;
//naoMat.SetFloat("_Alpha", 1);
// 进度条0-1之间闪烁3次
// _Alpha 0~1 闪烁3次
int flashCount = 3;
float flashDuration = 0.12f; // 每次闪烁的时间
float flashDuration = 1f; // 每次闪烁的时间
Sequence seq = DOTween.Sequence();
for (int i = 0; i < flashCount; i++)
{
seq.Append(DOTween.To(
() => m_imgValue.fillAmount,
x => m_imgValue.fillAmount = x,
() => naoMat.GetFloat("_Alpha"),
x => naoMat.SetFloat("_Alpha", x),
0f, flashDuration / 2f
).SetEase(Ease.InQuad));
seq.Append(DOTween.To(
() => m_imgValue.fillAmount,
x => m_imgValue.fillAmount = x,
() => naoMat.GetFloat("_Alpha"),
x => naoMat.SetFloat("_Alpha", x),
1f, flashDuration / 2f
).SetEase(Ease.OutQuad));
}
// 最后回到当前进度
// 最后回到1
seq.Append(DOTween.To(
() => m_imgValue.fillAmount,
x => m_imgValue.fillAmount = x,
m_CurrentFillAmount, 0.18f
() => naoMat.GetFloat("_Alpha"),
x => naoMat.SetFloat("_Alpha", x),
1f, 0.18f
).SetEase(Ease.OutQuad));
await UniTask.Delay(2000);
// 特效播放完毕后销毁
GameObject.Destroy(actorHItem.gameObject);