コード例 #1
0
        protected override void LoadComplete()
        {
            base.LoadComplete();

            this.ScaleTo(0).Then().ScaleTo(1, APPEAR_DURATION, Easing.OutQuint);

            using (BeginDelayedSequence(RANK_CIRCLE_TRANSFORM_DELAY, true))
                innerMask.FillTo(1f, RANK_CIRCLE_TRANSFORM_DURATION, ACCURACY_TRANSFORM_EASING);

            using (BeginDelayedSequence(ACCURACY_TRANSFORM_DELAY, true))
            {
                double targetAccuracy = score.Rank == ScoreRank.X || score.Rank == ScoreRank.XH ? 1 : Math.Min(1 - virtual_ss_percentage, score.Accuracy);

                accuracyCircle.FillTo(targetAccuracy, ACCURACY_TRANSFORM_DURATION, ACCURACY_TRANSFORM_EASING);

                foreach (var badge in badges)
                {
                    if (badge.Accuracy > score.Accuracy)
                    {
                        continue;
                    }

                    using (BeginDelayedSequence(inverseEasing(ACCURACY_TRANSFORM_EASING, Math.Min(1 - virtual_ss_percentage, badge.Accuracy) / targetAccuracy) * ACCURACY_TRANSFORM_DURATION, true))
                        badge.Appear();
                }

                using (BeginDelayedSequence(TEXT_APPEAR_DELAY, true))
                    rankText.Appear();
            }
        }
コード例 #2
0
ファイル: AccuracyCircle.cs プロジェクト: omkelderman/osu
        protected override void LoadComplete()
        {
            base.LoadComplete();

            this.ScaleTo(0).Then().ScaleTo(1, APPEAR_DURATION, Easing.OutQuint);

            if (withFlair)
            {
                const double swoosh_pre_delay = 443f;
                const double swoosh_volume    = 0.4f;

                this.Delay(swoosh_pre_delay).Schedule(() =>
                {
                    swooshUpSound.VolumeTo(swoosh_volume);
                    swooshUpSound.Play();
                });
            }

            using (BeginDelayedSequence(RANK_CIRCLE_TRANSFORM_DELAY))
                innerMask.FillTo(1f, RANK_CIRCLE_TRANSFORM_DURATION, ACCURACY_TRANSFORM_EASING);

            using (BeginDelayedSequence(ACCURACY_TRANSFORM_DELAY))
            {
                double targetAccuracy = score.Rank == ScoreRank.X || score.Rank == ScoreRank.XH ? 1 : Math.Min(1 - virtual_ss_percentage, score.Accuracy);

                accuracyCircle.FillTo(targetAccuracy, ACCURACY_TRANSFORM_DURATION, ACCURACY_TRANSFORM_EASING);

                if (withFlair)
                {
                    Schedule(() =>
                    {
                        const double score_tick_debounce_rate_start = 18f;
                        const double score_tick_debounce_rate_end   = 300f;
                        const double score_tick_volume_start        = 0.6f;
                        const double score_tick_volume_end          = 1.0f;

                        this.TransformBindableTo(tickPlaybackRate, score_tick_debounce_rate_start);
                        this.TransformBindableTo(tickPlaybackRate, score_tick_debounce_rate_end, ACCURACY_TRANSFORM_DURATION, Easing.OutSine);

                        scoreTickSound.FrequencyTo(1 + targetAccuracy, ACCURACY_TRANSFORM_DURATION, Easing.OutSine);
                        scoreTickSound.VolumeTo(score_tick_volume_start).Then().VolumeTo(score_tick_volume_end, ACCURACY_TRANSFORM_DURATION, Easing.OutSine);

                        isTicking = true;
                    });
                }

                int badgeNum = 0;

                foreach (var badge in badges)
                {
                    if (badge.Accuracy > score.Accuracy)
                    {
                        continue;
                    }

                    using (BeginDelayedSequence(inverseEasing(ACCURACY_TRANSFORM_EASING, Math.Min(1 - virtual_ss_percentage, badge.Accuracy) / targetAccuracy) * ACCURACY_TRANSFORM_DURATION))
                    {
                        badge.Appear();

                        if (withFlair)
                        {
                            Schedule(() =>
                            {
                                var dink = badgeNum < badges.Count - 1 ? badgeTickSound : badgeMaxSound;

                                dink.FrequencyTo(1 + badgeNum++ *0.05);
                                dink.Play();
                            });
                        }
                    }
                }

                using (BeginDelayedSequence(TEXT_APPEAR_DELAY))
                {
                    rankText.Appear();

                    if (!withFlair)
                    {
                        return;
                    }

                    Schedule(() =>
                    {
                        isTicking = false;
                        rankImpactSound.Play();
                    });

                    const double applause_pre_delay = 545f;
                    const double applause_volume    = 0.8f;

                    using (BeginDelayedSequence(applause_pre_delay))
                    {
                        Schedule(() =>
                        {
                            rankApplauseSound.VolumeTo(applause_volume);
                            rankApplauseSound.Play();
                        });
                    }
                }
            }
        }