Esempio n. 1
0
    private void Update_TriggerStatus()
    {
        slidePart[] a = new slidePart[] { Bad1, Good, Perfect, Bad2 };

        float r = moveRange / 360f;
        float total = a.Select(x => x.triggerPoint).Sum();
        if (total == 0)
            return;
        float rot = 0;
        for (int i = 0; i < a.Length; i++)
        {
            a[i].t.localRotation = Quaternion.Euler(0, 0, rot);
            a[i].Image.fillAmount = r * (a[i].triggerPoint / total);
            rot -= moveRange * (a[i].triggerPoint / total);
        }
    }
Esempio n. 2
0
    state statusCheck()
    {
        slidePart[] a = new slidePart[] { Bad1, Good, Perfect, Bad2 };

        float total = a.Select(x => x.triggerPoint).Sum();
        if (total == 0)
            return state.bad;
        float called = -(curve - (moveRange / 2f)) / moveRange;
        float counter = 0;
        int heighest = 0;

        for (int i = 0; i < a.Length; i++)
        {
            if (called > counter)
                heighest = i;

            counter += a[i].triggerPoint / total;
        }
        return a[heighest].State;
    }