Exemplo n.º 1
0
    public void JudgementCheck(int direction)
    {
        foreach (JudgementPoint judgementPoint in judgementPoints)
        {
            if (judgementPoint == null)
            {
                continue;
            }

            if (judgementPoint.direction.Equals(direction))
            {
                tempjudgementPoint = judgementPoint;
                if (tempjudgementPoint.obj.transform.localScale.x <= 1f - perfectRange ||
                    tempjudgementPoint.obj.transform.localScale.x <= 1f + perfectRange)
                {
                    FindObjectOfType <ScoreManager>().ScoreUp("Perfect");
                }
                else if (tempjudgementPoint.obj.transform.localScale.x <= 1f - GoodRange ||
                         tempjudgementPoint.obj.transform.localScale.x <= 1f + GoodRange)
                {
                    FindObjectOfType <ScoreManager>().ScoreUp("Good");
                }
                else if (tempjudgementPoint.obj.transform.localScale.x <= 1f - NormalRange ||
                         tempjudgementPoint.obj.transform.localScale.x <= 1f + NormalRange)
                {
                    FindObjectOfType <ScoreManager>().ScoreUp("Normal");
                }
                else
                {
                    FindObjectOfType <ScoreManager>().ScoreUp("Bad");
                }
                Destroy(judgementPoint.obj);
                break;
            }
        }
        if (tempjudgementPoint != null)
        {
            judgementPoints.Remove(tempjudgementPoint);
        }
    }
Exemplo n.º 2
0
    void FixedUpdate()
    {
        foreach (JudgementPoint judgementPoint in judgementPoints)
        {
            if (judgementPoint == null || judgementPoint.obj == null)
            {
                continue;
            }

            judgementPoint.obj.transform.localScale -= Vector3.one * Time.deltaTime;
            if (judgementPoint.obj.transform.localScale.x <= 0.0f)
            {
                tempjudgementPoint = judgementPoint;
                Destroy(judgementPoint.obj);
                break;
            }
        }
        if (tempjudgementPoint != null)
        {
            judgementPoints.Remove(tempjudgementPoint);
        }
    }