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