/// <summary> /// フェードアウト / シーンの最後、徐々に暗くするときに使う /// </summary> /// <param name="duration"></param> /// <param name="beginByReset"></param> /// <param name="finishCallback"></param> async public UniTask FadeOutToBlack(CancellationToken cancellationToken, float duration = DEFAULT_FADE_TIME, bool beginByReset = true) { if (beginByReset) { fadeImage.SetAlpha(0f); } await LibFunction.FadeUIAsync(fadeImage, cancellationToken, 1, duration); }
/// <summary> /// 適当に明滅させる /// </summary> /// <param name="graphic"></param> /// <param name="flashNum"></param> /// <param name="duration"></param> /// <param name="finishCallback"></param> /// <returns></returns> static public async UniTask FlashUIAsync(MaskableGraphic graphic, CancellationToken cancellationToken, int flashNum = 5, float duration = 0.06f) { for (int i = 0; i < flashNum; i++) { // 適当にYOYO風に明滅 await LibFunction.FadeUIAsync(graphic, cancellationToken, 0, duration); await LibFunction.FadeUIAsync(graphic, cancellationToken, 1, duration); } }