コード例 #1
0
    // Update is called once per frame
    void Update()
    {
        ChartEditor editor = ChartEditor.Instance;

        if (editor.currentState == ChartEditor.State.Playing && !GameSettings.bot)
        {
            Chart.GameMode gameMode = editor.currentChart.gameMode;
            LaneInfo       laneInfo = editor.laneInfo;

            if (gameMode == Chart.GameMode.Drums)
            {
                foreach (Note.DrumPad drumPad in EnumX <Note.DrumPad> .Values)
                {
                    if (bannedDrumPadInputs.ContainsKey(drumPad))
                    {
                        continue;
                    }

                    if (DrumsInput.GetPadPressedInput(drumPad, laneInfo))
                    {
                        animations[(int)drumPad].Press();
                    }
                    else
                    {
                        animations[(int)drumPad].Release();
                    }
                }
            }
            else
            {
                foreach (Note.GuitarFret fret in EnumX <Note.GuitarFret> .Values)
                {
                    if (bannedFretInputs.ContainsKey(fret))
                    {
                        continue;
                    }

                    if (GuitarInput.GetFretInput(fret))
                    {
                        animations[(int)fret].Press();
                    }
                    else
                    {
                        animations[(int)fret].Release();
                    }
                }
            }
        }
        else
        {
            for (int i = 0; i < animations.Length; ++i)
            {
                if (!animations[i].running)
                {
                    animations[i].Release();
                }
            }
        }
    }
コード例 #2
0
    void UpdateGuitarFretPresses()
    {
        foreach (Note.GuitarFret fret in EnumX <Note.GuitarFret> .Values)
        {
            if (bannedFretInputs.ContainsKey(fret))
            {
                continue;
            }

            if (GuitarInput.GetFretInput(fret))
            {
                animations[(int)fret].Press();
            }
            else
            {
                animations[(int)fret].Release();
            }
        }
    }
コード例 #3
0
    // Update is called once per frame
    void Update()
    {
        ChartEditor editor = ChartEditor.Instance;

        if (editor.currentState == ChartEditor.State.Playing && !GameSettings.bot)
        {
            Chart.GameMode gameMode = editor.currentChart.gameMode;
            LaneInfo       laneInfo = editor.laneInfo;

            if (gameMode == Chart.GameMode.Drums)
            {
                foreach (Note.DrumPad drumPad in EnumX <Note.DrumPad> .Values)
                {
                    if (bannedDrumPadInputs.ContainsKey(drumPad))
                    {
                        continue;
                    }

                    bool lanePressed = false;
                    switch (GameSettings.drumsModeOptions)
                    {
                    case GameSettings.DrumModeOptions.ProDrums:
                    {
                        lanePressed = DrumsInput.GetTomPressedInput(drumPad, laneInfo) || DrumsInput.GetCymbalPressedInput(drumPad, laneInfo);
                        break;
                    }

                    default:
                    {
                        lanePressed = DrumsInput.GetPadPressedInput(drumPad, laneInfo);
                        break;
                    }
                    }

                    if (lanePressed)
                    {
                        animations[(int)drumPad].Press();
                    }
                    else
                    {
                        animations[(int)drumPad].Release();
                    }
                }
            }
            else
            {
                foreach (Note.GuitarFret fret in EnumX <Note.GuitarFret> .Values)
                {
                    if (bannedFretInputs.ContainsKey(fret))
                    {
                        continue;
                    }

                    if (GuitarInput.GetFretInput(fret))
                    {
                        animations[(int)fret].Press();
                    }
                    else
                    {
                        animations[(int)fret].Release();
                    }
                }
            }
        }
        else
        {
            for (int i = 0; i < animations.Length; ++i)
            {
                if (!animations[i].running)
                {
                    animations[i].Release();
                }
            }
        }
    }