超大量的更新 修复很多问题,gameplay特效初步
This commit is contained in:
@@ -15,7 +15,9 @@ public class UI_Show_Anim : MonoBehaviour
|
||||
{
|
||||
canvasGroup.alpha = 0;
|
||||
float a = 0;
|
||||
DOTween.To(() => a, (f) => { a = f; canvasGroup.alpha = f; }, 1, animTime_Alpha).SetUpdate(true);
|
||||
DOTween.To(() => a, (f) => { a = f; canvasGroup.alpha = f; }, 1, animTime_Alpha)
|
||||
.SetUpdate(true)
|
||||
.SetTarget(canvasGroup);
|
||||
}
|
||||
}
|
||||
public void Close()
|
||||
@@ -25,11 +27,20 @@ public class UI_Show_Anim : MonoBehaviour
|
||||
if (gameObject.Try_Get_Component(out CanvasGroup canvasGroup))
|
||||
{
|
||||
float a = 1;
|
||||
DOTween.To(() => a, (f) => { a = f; canvasGroup.alpha = f; }, 0, animTime_Alpha).SetUpdate(true);
|
||||
DOTween.To(() => a, (f) => { a = f; canvasGroup.alpha = f; }, 0, animTime_Alpha)
|
||||
.SetUpdate(true)
|
||||
.SetTarget(canvasGroup);
|
||||
}
|
||||
}
|
||||
void Clear()
|
||||
{
|
||||
DOTween.KillAll(transform);
|
||||
// Only kill tweens that belong to this UI element.
|
||||
// Passing a Transform into DOTween.KillAll(...) is dangerous in Unity because Transform has an implicit bool
|
||||
// conversion, which ends up calling KillAll(true) and wipes tweens globally.
|
||||
transform.DOKill();
|
||||
if (gameObject.Try_Get_Component(out CanvasGroup canvasGroup))
|
||||
{
|
||||
canvasGroup.DOKill();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user