Exemplo n.º 1
0
    /////////////////////////////////////////////

    //UI関連 関数////////////////////////////////
    void JudgeTextUpdate(JudgeEnum judgeEnum)
    {
        switch (judgeEnum)
        {
        case JudgeEnum.perfect:
            //虹色で"ぱぁふぇくと"
            judgeText.text = "<color=#ff0000>ぱ</color><color=#ffff00>ぁ</color><color=#00ff00>ふ</color><color=#00ffff>ぇ</color><color=#0000ff>く</color><color=#ff00ff>と</color>";
            break;

        case JudgeEnum.great:
            //黄色で"ぐれぇと"
            judgeText.text = "<color=#ffff00>ぐれぇと</color>";
            break;

        case JudgeEnum.good:
            //緑色で"ぐれぇと"
            judgeText.text = "<color=#00ff00>ぐっど</color>";
            break;

        case JudgeEnum.bad:
            //青色で"ばっど"
            judgeText.text = "<color=#0000ff>ばっど</color>";
            break;

        case JudgeEnum.miss:
            //灰色で"みす"
            judgeText.text = "<color=#7f7f7f>みす</color>";
            break;
        }
        judgeTextCanvasGroup.alpha = 1;
        judgeTextFadeOut           = true;
    }
Exemplo n.º 2
0
    bool HoldJudgeCheck(LaneEnum laneEnum, int noteNum)
    {
        int   laneInt = (int)laneEnum;
        float notePerfectJudgeTime = noteInstDatas[laneInt][noteNum].notePerfectJudgeTime;

        if (songPlayingTime >= notePerfectJudgeTime)
        {
            noteInstDatas[laneInt][noteNum].holdJudge = false;
            if (!touchHold[laneInt])
            {
                return(false);
            }
            float liftPosX = lift[laneInt].transform.position.x;
            float notePosX = noteInstDatas[laneInt][noteNum].noteInst.transform.position.x;
            for (JudgeEnum judgeEnum = JudgeEnum.perfect; judgeEnum != JudgeEnum.miss; judgeEnum++)
            {
                int judgeInt = (int)judgeEnum;
                if (liftPosX + holdJudgePos[judgeInt] >= notePosX - holdJudgePos[judgeInt] && liftPosX - holdJudgePos[judgeInt] <= notePosX + holdJudgePos[judgeInt])
                {
                    Judge(judgeEnum, laneEnum, noteNum);
                    return(true);
                }
            }
        }
        return(false);
    }
Exemplo n.º 3
0
    void TapJudgeCheck(LaneEnum laneEnum, int noteNum)
    {
        int   laneInt  = (int)laneEnum;
        float liftPosX = lift[laneInt].transform.position.x;
        float notePosX = noteInstDatas[laneInt][noteNum].noteInst.transform.position.x;

        float inputGapTime = songPlayingTime - songAudio.time;


        //判定デバッグ
        inputGapText.text = "inputgap: " + inputGapTime;
        gapTimeAdd       += noteInstDatas[laneInt][noteNum].notePerfectJudgeTime - songPlayingTime;
        judgeCount++;
        gapText.text = "gap:" + (gapTimeAdd / judgeCount);


        if (liftPosX + tapJudgePosX >= notePosX - tapJudgePosX && liftPosX - tapJudgePosX <= notePosX + tapJudgePosX)
        {
            float notePerfectJudgeTime = noteInstDatas[laneInt][noteNum].notePerfectJudgeTime;
            for (JudgeEnum judgeEnum = JudgeEnum.perfect; judgeEnum != JudgeEnum.miss; judgeEnum++)
            {
                int judgeInt = (int)judgeEnum;
                if (songPlayingTime >= notePerfectJudgeTime - tapJudgeTime[judgeInt] && songPlayingTime <= notePerfectJudgeTime + tapJudgeTime[judgeInt])
                {
                    Judge(judgeEnum, laneEnum, noteNum);
                    return;
                }
            }
        }
    }
Exemplo n.º 4
0
    void Judgement()
    {
        if (playerController.IsSurrender)
        {
            judgeEnum           = JudgeEnum.Lose;
            judgementText.text  = "SURRENDER";
            judgementText.color = Color.blue;
            return;
        }

        int playerScore = playerController.GetScore();
        int dealerScore = dealerController.GetScore();

        if (playerScore > dealerScore)
        {
            judgeEnum           = JudgeEnum.Win;
            judgementText.text  = "WIN!!";
            judgementText.color = Color.yellow;
        }
        else if (playerScore == dealerScore)
        {
            judgeEnum           = JudgeEnum.Draw;
            judgementText.text  = "DRAW";
            judgementText.color = Color.grey;
        }
        else if (playerScore < dealerScore)
        {
            judgeEnum           = JudgeEnum.Lose;
            judgementText.text  = "LOSE...";
            judgementText.color = Color.blue;
        }
    }
Exemplo n.º 5
0
    /////////////////////////////////////////////

    //判定関連 関数//////////////////////////////
    void Judge(JudgeEnum judgeEnum, LaneEnum laneEnum, int noteNum)
    {
        int judgeInt = (int)judgeEnum;
        int laneInt  = (int)laneEnum;
        int feverInt = (int)noteInstDatas[laneInt][noteNum].feverEnum;

        judgeCount++;
        judge[judgeInt]++;
        JudgeTextUpdate(judgeEnum);
        if (judgeEnum == JudgeEnum.perfect || judgeEnum == JudgeEnum.great || judgeEnum == JudgeEnum.good)
        {
            int                       tempJudgeCoef        = judgeCoef[judgeInt];
            int                       tempFeverCoef        = feverCoef[feverInt];
            float                     tempHealth           = nowHealth + tempJudgeCoef * tempFeverCoef * SelectSceneManager.musicDatas[SelectSceneManager.selectSongFileInt].heel;
            Vector3                   noteParticlePos      = noteInstDatas[laneInt][noteNum].noteInst.transform.position;
            Color                     noteParticleColor    = noteInstDatas[laneInt][noteNum].noteColor;
            ParticleSystem            noteParticleInst     = Instantiate(noteParticlePrefab, noteParticlePos, Quaternion.identity);
            ParticleSystem.MainModule noteParticleInstMain = noteParticleInst.main;
            noteParticleInstMain.startColor = noteParticleColor;
            noteParticleInst.Play();
            judgeAudio.PlayOneShot(judgeClip);
            nowCombo++;
            maxCombo  = Mathf.Max(maxCombo, nowCombo);
            score    += tempJudgeCoef * tempFeverCoef * Mathf.Sqrt(nowCombo) * Mathf.Sqrt(SelectSceneManager.musicDatas[SelectSceneManager.selectSongFileInt].difficulty) * 10.0f;
            nowHealth = tempHealth <= maxHealth ? tempHealth : maxHealth;
            ScoreTextUpdate();
            ComboTextUpdate();
        }
        else if (judgeEnum == JudgeEnum.bad || judgeEnum == JudgeEnum.miss)
        {
            int   tempFeverCoef = feverCoef[feverInt];
            float tempHealth    = nowHealth - tempFeverCoef * SelectSceneManager.musicDatas[SelectSceneManager.selectSongFileInt].damage;
            nowCombo  = 0;
            nowHealth = tempHealth >= 0 ? tempHealth : 0;
            if (nowHealth == 0)
            {
                GameOver();
            }
        }
        HealthTextUpdate();
        HealthSliderImageUpdate();
        Destroy(noteInstDatas[laneInt][noteNum].noteInst.gameObject);
        noteInstDatas[laneInt].RemoveAt(noteNum);
    }