File tree Expand file tree Collapse file tree 2 files changed +34
-0
lines changed
Expand file tree Collapse file tree 2 files changed +34
-0
lines changed Original file line number Diff line number Diff line change @@ -6,6 +6,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
66
77## [ Unreleased]
88- Added option to tween using unscaled delta time.
9+ - Added WaitForTween custom yield instruction.
910- Added JetBrain annotations.
1011- Replaced exceptions with Debug.Warning.
1112
Original file line number Diff line number Diff line change @@ -491,4 +491,37 @@ private sealed class TweenMono : MonoBehaviour
491491
492492 #endregion
493493 }
494+
495+ #region Other types
496+
497+ /// <summary>
498+ /// Yield instruction that waits for a given tween instance to finish.
499+ /// Usage: yield return new WaitForTween(...)
500+ /// </summary>
501+ public sealed class WaitForTween : CustomYieldInstruction
502+ {
503+ #region Fields
504+
505+ [ PublicAPI , CanBeNull ]
506+ public readonly Tween Tween ;
507+
508+ #endregion
509+
510+ #region Constructors
511+
512+ public WaitForTween ( [ CanBeNull ] Tween tween )
513+ {
514+ Tween = tween ;
515+ }
516+
517+ #endregion
518+
519+ #region Properties
520+
521+ public override bool keepWaiting => Tween ? . IsActive ?? false ;
522+
523+ #endregion
524+ }
525+
526+ #endregion
494527}
You can’t perform that action at this time.
0 commit comments