Exemple #1
0
    void OnGUI()
    {
        GUI.Label(new Rect(10, Screen.height - 40, 500, 50), "headset connected: " + headsetConnected.ToString());

        if (GUI.Button(new Rect(Screen.width - 150, 150, 150, 50), "Detect"))
        {
            headsetConnected = DetectHeadset.Detect();
        }
    }
Exemple #2
0
 void Start()
 {
     headsetConnected = DetectHeadset.Detect();
 }
Exemple #3
0
    public void OnGameLoaded(Game game)
    {
        var chart = game.Chart;

        var lp = Context.Player;

        ChartOffset = lp.Settings.BaseNoteOffset + game.Level.Record.RelativeNoteOffset;
        if (DetectHeadset.Detect())
        {
            ChartOffset += lp.Settings.HeadsetNoteOffset;
        }

        UseScannerSmoothing = true;
        DisplayNoteIds      = Context.Player.Settings.DisplayNoteIds;

        GlobalRingColorOverride = chart.Model.ring_color?.ToColor() ?? Color.clear;
        foreach (NoteType type in Enum.GetValues(typeof(NoteType)))
        {
            GlobalFillColorsOverride[type] = new[]
            {
                chart.Model.fill_colors[NoteColorChartOverrideMapping[type][0]]?.ToColor() ?? Color.clear,
                chart.Model.fill_colors[NoteColorChartOverrideMapping[type][1]]?.ToColor() ?? Color.clear
            };
        }

        GlobalNoteSizeMultiplier = (float)chart.Model.size * (1 + 0.133333f + lp.Settings.NoteSize);

        NoteSizes[NoteType.Click]     = NoteSizes[NoteType.CDragHead] = (game.camera.orthographicSize * 2.0f) * (7.0f / 9.0f) / 5.0f * 1.2675f;
        NoteSizes[NoteType.DragHead]  = NoteSizes[NoteType.Click] * 0.8f;
        NoteSizes[NoteType.DragChild] = NoteSizes[NoteType.CDragChild] = NoteSizes[NoteType.Click] * 0.65f;
        NoteSizes[NoteType.Hold]      = NoteSizes[NoteType.Click];
        NoteSizes[NoteType.LongHold]  = NoteSizes[NoteType.Click];
        NoteSizes[NoteType.Flick]     = NoteSizes[NoteType.Click] * 1.125f;

        NoteHitboxSizes[NoteType.Click] = NoteHitboxSizes[NoteType.CDragHead] =
            new[] { 0.666666f * 1.111111f, 0.666666f * 1.333333f, 0.666666f * 1.555555f }[lp.Settings.HitboxSizes[NoteType.Click]];
        NoteHitboxSizes[NoteType.DragHead] =
            new[] { 0.666666f * 1.111111f, 0.666666f * 1.333333f, 0.666666f * 1.555555f }[lp.Settings.HitboxSizes[NoteType.DragChild]];
        NoteHitboxSizes[NoteType.DragChild] = NoteHitboxSizes[NoteType.CDragChild] =
            new[] { 0.888888f * 1.111111f, 0.888888f * 1.333333f, 0.888888f * 1.555555f }[lp.Settings.HitboxSizes[NoteType.DragChild]];
        NoteHitboxSizes[NoteType.Hold] = NoteHitboxSizes[NoteType.LongHold] =
            new[] { 0.888888f * 1.111111f, 0.888888f * 1.333333f, 0.888888f * 1.555555f }[lp.Settings.HitboxSizes[NoteType.Hold]];
        NoteHitboxSizes[NoteType.Flick] =
            new[] { 0.888888f * 1.111111f, 0.888888f * 1.333333f, 0.888888f * 1.555555f }[lp.Settings.HitboxSizes[NoteType.Flick]];

        foreach (NoteType type in Enum.GetValues(typeof(NoteType)))
        {
            var eqType = type;
            if (type == NoteType.DragHead)
            {
                eqType = NoteType.DragChild;
            }
            if (type == NoteType.CDragHead)
            {
                eqType = NoteType.CDragChild;
            }
            NoteRingColors[type] = new[]
            {
                chart.Model.ring_color?.ToColor() ?? lp.Settings.NoteRingColors[NoteType.Click],
                                                     chart.Model.ring_color?.ToColor() ?? lp.Settings.NoteRingColors[NoteType.Click]
            };
            NoteFillColors[type] = new[]
            {
                chart.Model.fill_colors[NoteColorChartOverrideMapping[type][0]]?.ToColor() ??
                lp.Settings.NoteFillColors[eqType],
                chart.Model.fill_colors[NoteColorChartOverrideMapping[type][1]]?.ToColor() ??
                lp.Settings.NoteFillColorsAlt[eqType],
            };
        }

        NoteGradeEffectColors = new Dictionary <NoteGrade, Color>
        {
            { NoteGrade.Perfect, "#5BC0EB".ToColor() },
            { NoteGrade.Great, "#FDE74C".ToColor() },
            { NoteGrade.Good, "#9BC53D".ToColor() },
            { NoteGrade.Bad, "#E55934".ToColor() },
            { NoteGrade.Miss, "#333333".ToColor() },
        };

        if (game.Storyboard != null && game.Storyboard.Controllers.Count > 0)
        {
            game.Storyboard.Config.UseEffects = Context.Player.Settings.DisplayStoryboardEffects;
        }

        Context.UpdateGraphicsQuality();
    }