Skip to content

Commit

Permalink
Refactoring.
Browse files Browse the repository at this point in the history
  • Loading branch information
ChebanovDD committed Aug 22, 2022
1 parent bf765d9 commit 0a142af
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,13 @@ public async UniTask ActivateAsync()
{
visible = true;
style.opacity = 1;
await this.WaitForLongestTransition();
await this.WaitForLongestTransitionEnd();
}

public async UniTask DeactivateAsync()
{
style.opacity = 0;
await this.WaitForLongestTransition();
await this.WaitForLongestTransitionEnd();

visible = false;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ public async UniTask ActivateAsync()
SetOpacity(1);
SetPaddingBottom(_defaultPaddingBottom);

await this.WaitForLongestTransition();
await this.WaitForLongestTransitionEnd();
}

public async UniTask DeactivateAsync()
Expand All @@ -57,7 +57,7 @@ public async UniTask DeactivateAsync()
SetOpacity(0);
SetPaddingBottom(_initialPaddingBottom);

await this.WaitForLongestTransition();
await this.WaitForLongestTransitionEnd();

SetVisible(false);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public static class TransitionAsyncExtensions
private const char Dash = '-';
private const int DefaultTimeoutMs = 2500;

public static async UniTask WaitForLongestTransition(this VisualElement element,
public static async UniTask WaitForLongestTransitionEnd(this VisualElement element,
CancellationToken cancellationToken = default)
{
var maxTransitionDelay = element.resolvedStyle.transitionDuration.Max(duration =>
Expand Down

0 comments on commit 0a142af

Please sign in to comment.