File tree Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Expand file tree Collapse file tree 4 files changed +11
-5
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ public abstract class DelayUiPresenter : UiPresenter
1212
1313 private void OnValidate ( )
1414 {
15- _delayer = _delayer ?? GetComponent < PresenterDelayerBase > ( ) ;
15+ _delayer = _delayer != null ? _delayer : GetComponent < PresenterDelayerBase > ( ) ;
1616
1717 OnEditorValidate ( ) ;
1818 }
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ namespace GameLovers.UiService
88 /// <remarks>
99 /// Allows this Presenter to have an intro and outro animation when opened and closed to provide feedback and joy for players.
1010 /// </remarks>
11+ [ RequireComponent ( typeof ( Animation ) ) ]
1112 public class AnimationDelayer : PresenterDelayerBase
1213 {
1314 [ SerializeField ] protected Animation _animation ;
@@ -20,6 +21,11 @@ public class AnimationDelayer : PresenterDelayerBase
2021 /// <inheritdoc />
2122 public override float CloseDelayInSeconds => _outroAnimationClip . length * 1000 ;
2223
24+ private void OnValidate ( )
25+ {
26+ _animation = _animation != null ? _animation : GetComponent < Animation > ( ) ;
27+ }
28+
2329 protected override void OnOpenStarted ( )
2430 {
2531 _animation . clip = _introAnimationClip ;
Original file line number Diff line number Diff line change @@ -10,13 +10,13 @@ namespace GameLovers.UiService
1010 /// </remarks>
1111 public class TimeDelayer : PresenterDelayerBase
1212 {
13- [ SerializeField ] protected float _openDelayInSeconds ;
14- [ SerializeField ] protected float _closeDelayInSeconds ;
13+ [ SerializeField , Range ( 0f , float . MaxValue ) ] protected float _openDelayInSeconds ;
14+ [ SerializeField , Range ( 0f , float . MaxValue ) ] protected float _closeDelayInSeconds ;
1515
1616 /// <inheritdoc />
1717 public override float OpenDelayInSeconds => _openDelayInSeconds ;
1818
1919 /// <inheritdoc />
20- public override float CloseDelayInSeconds => _openDelayInSeconds ;
20+ public override float CloseDelayInSeconds => _closeDelayInSeconds ;
2121 }
2222}
Original file line number Diff line number Diff line change @@ -275,7 +275,7 @@ public void CloseAllUi()
275275 /// <inheritdoc />
276276 public void CloseAllUi ( int layer )
277277 {
278- for ( int i = 0 ; i < _visibleUiList . Count ; i ++ )
278+ for ( int i = _visibleUiList . Count - 1 ; i >= 0 ; i -- )
279279 {
280280 var type = _visibleUiList [ i ] ;
281281
You can’t perform that action at this time.
0 commit comments