Example #1
0
    int SliderType2TapIndex(SliderType_BeatSaber type)
    {
        switch (type)
        {
        case SliderType_BeatSaber.LEFT_DOWN:
            return(2);

        case SliderType_BeatSaber.RIGHT_DOWN:
            return(3);

        default:
            return(0);
        }
    }
Example #2
0
    public RevolvingBoxSlider(GameObject boxSliderPrefab, SliderType_BeatSaber type, int sliderCnt = 8, float radius = 3f, EventHandler SliderValueChanged = null)
    {
        float radian = 2f * Mathf.PI / (float)sliderCnt;
        float angle  = 360f / (float)sliderCnt;

        sliders = new BoxSlider_BeatSaber[sliderCnt];

        for (int i = 0; i < sliderCnt; i++)
        {
            Vector3             slider_pos = new Vector3(radius * Mathf.Sin(i * radian), 0, radius * (-Mathf.Cos(i * radian)));
            GameObject          boxSlider  = GameObject.Instantiate(boxSliderPrefab, slider_pos, Quaternion.identity);
            BoxSlider_BeatSaber slider     = boxSlider.GetComponent <BoxSlider_BeatSaber>();
            slider.Init(type + i + 1);
            boxSlider.transform.rotation = Quaternion.Euler(0, i * 45, 0);
            slider.ValueChanged         += SliderValueChanged;
            sliders[i] = slider;
        }
    }