示例#1
0
        private void updateState(DrawableHitObject drawableObject, ArmedState state)
        {
            const double legacy_fade_duration = 240;

            using (BeginAbsoluteSequence(drawableObject.HitStateUpdateTime, true))
            {
                switch (state)
                {
                case ArmedState.Hit:
                    circleSprites.FadeOut(legacy_fade_duration, Easing.Out);
                    circleSprites.ScaleTo(1.4f, legacy_fade_duration, Easing.Out);

                    if (hasNumber)
                    {
                        var legacyVersion = skin.GetConfig <LegacySetting, decimal>(LegacySetting.Version)?.Value;

                        if (legacyVersion >= 2.0m)
                        {
                            // legacy skins of version 2.0 and newer only apply very short fade out to the number piece.
                            hitCircleText.FadeOut(legacy_fade_duration / 4, Easing.Out);
                        }
                        else
                        {
                            // old skins scale and fade it normally along other pieces.
                            hitCircleText.FadeOut(legacy_fade_duration, Easing.Out);
                            hitCircleText.ScaleTo(1.4f, legacy_fade_duration, Easing.Out);
                        }
                    }

                    break;
                }
            }
        }
示例#2
0
        private void updateState(ValueChangedEvent <ArmedState> state)
        {
            const double legacy_fade_duration = 240;

            switch (state.NewValue)
            {
            case ArmedState.Hit:
                circleSprites.FadeOut(legacy_fade_duration, Easing.Out);
                circleSprites.ScaleTo(1.4f, legacy_fade_duration, Easing.Out);

                var legacyVersion = skin.GetConfig <LegacySetting, decimal>(LegacySetting.Version)?.Value;

                if (legacyVersion >= 2.0m)
                {
                    // legacy skins of version 2.0 and newer only apply very short fade out to the number piece.
                    hitCircleText.FadeOut(legacy_fade_duration / 4, Easing.Out);
                }
                else
                {
                    // old skins scale and fade it normally along other pieces.
                    hitCircleText.FadeOut(legacy_fade_duration, Easing.Out);
                    hitCircleText.ScaleTo(1.4f, legacy_fade_duration, Easing.Out);
                }

                break;
            }
        }