private IEnumerator PickProcess(float duration, Action callBack) { float t = 0; //初始化进度条 UIUtilities.DoFadeUI(pickupSlider.gameObject, 1, 0f, Ease.InOutBack); pickupSlider.value = 0; isPicking = true; while (t < duration) { yield return(null); t += Time.deltaTime; pickupSlider.value = t / duration; if (!isPicking) { UIUtilities.DoFadeUI(pickupSlider.gameObject, 0, 0.2f, Ease.InOutBack); yield break; } } if (callBack != null) { callBack.Invoke(); } UIUtilities.DoFadeUI(pickupSlider.gameObject, 0, 0.2f, Ease.InOutBack); }