예제 #1
0
        private void OnHitRegistered(EvtHitMessage msg, ScoreComponent component)
        {
            switch (msg.State)
            {
            case BeatKeyState.Red:
                component.HyperScore.Value = Mathf.Max(component.MinHyperScore,
                                                       component.HyperScore.Value + component.RedHitPoints);
                break;

            case BeatKeyState.Yellow:
                component.HyperScore.Value = Mathf.Min(component.MaxHyperScore,
                                                       component.HyperScore.Value + component.YellowPoints);
                break;

            case BeatKeyState.Green:
                component.HyperScore.Value = Mathf.Min(component.MaxHyperScore,
                                                       component.HyperScore.Value + component.GreenPoints);
                break;

            default:
                component.HyperScore.Value = component.HyperScore.Value;
                break;
            }

            var value = component.HyperScore.Value;

            if (value <= (int)HyperLevel.Failing)
            {
                component.HyperLevel.Value = HyperLevel.Failing;
            }
            else if (value < (int)HyperLevel.Normal)
            {
                component.HyperLevel.Value = HyperLevel.Shitty;
            }
            else if (value < (int)HyperLevel.Cool)
            {
                component.HyperLevel.Value = HyperLevel.Normal;
            }
            else if (value < (int)HyperLevel.Hot)
            {
                component.HyperLevel.Value = HyperLevel.Cool;
            }
            else if (value > (int)HyperLevel.Hot)
            {
                component.HyperLevel.Value = HyperLevel.Hot;
            }

            component.FullScore.Value += component.HyperScore.Value;
        }
예제 #2
0
        private void ChangeSpriteToFinal(EvtHitMessage obj, TargetKeyAnimationComponent targetComponent)
        {
            targetComponent.Backgrounds[0].gameObject.SetActive(false);

            switch (obj.State)
            {
            case BeatKeyState.Green:
                targetComponent.Backgrounds[1].gameObject.SetActive(true);
                break;

            case BeatKeyState.Yellow:
                targetComponent.Backgrounds[2].gameObject.SetActive(true);
                break;

            case BeatKeyState.Red:
                targetComponent.Backgrounds[3].gameObject.SetActive(true);
                break;
            }
        }