Esempio n. 1
0
    // Update is called once per frame
    void Update()
    {
        if (iLastScoreIndex < mainScene.uiScoreTextGrp.Length)
        {
            if ((fScoreDelay -= Time.deltaTime) <= 0.00f)
            {
                fScoreDelay = GameDatas.FLOAT_SCOREBOARD_DELAY_TIMER;

                // Head -> UpperR -> UpperL -> LowerR -> LowerL
                scoreGrp[iLastScoreIndex].text.text = (mainScene.objDummy.hitCounter[iLastScoreIndex] + GameDatas.STRING_HIT);
                scoreGrp[iLastScoreIndex].ChangeSize(0.00f, 125);
                scoreGrp[iLastScoreIndex].ChangeScale(0.50f, 1.00f);

                if (mainScene.objDummy.hitCounter[iLastScoreIndex] > 10)
                {
                    scoreGrp[iLastScoreIndex].ChangeSize(0.10f, 130);
                    scoreGrp[iLastScoreIndex].text.text += "!";
                }
                else if (mainScene.objDummy.hitCounter[iLastScoreIndex] > 30)
                {
                    scoreGrp[iLastScoreIndex].ChangeSize(0.10f, 135);
                    scoreGrp[iLastScoreIndex].text.text += "!!";
                }

                ++iLastScoreIndex;
            }
        }
        else if (!bFinisherScoreShown)
        {
            bFinisherScoreShown = true;

            int iFinisherPower = (int)(mainScene.objDummy.fFinisherPower);

            finisherScoreImg.ChangeScale(0.20f, 1.00f);
            finisherScoreImg.ChangeAlpha(0.20f, 1.00f);
            finisherScoreText.text.text = iFinisherPower.ToString();
            finisherScoreText.ChangeScale(0.25f, 1.00f);

            RenewRanking(iFinisherPower);
        }
        else
        {
            // Waiting for punching...
            if (punchToMainText.text.color.a == 1.00f)
            {
                punchToMainText.ChangeAlpha(0.75f, 0.00f);
            }
            else if (punchToMainText.text.color.a == 0.00f)
            {
                punchToMainText.ChangeAlpha(0.50f, 1.00f);
            }

            if (inputMgr.CheckInputs())
            {
                FinishState();
            }
        }

        inputMgr.InitInputs();
    }
Esempio n. 2
0
    public void RenewRanking(int finisherPower)
    {
        bool bRankChanged = false;

        if (GameDatas.INT_SAVED_SCORES[0] < finisherPower)
        {
            GameDatas.INT_SAVED_SCORES[2] = GameDatas.INT_SAVED_SCORES[1];
            GameDatas.INT_SAVED_SCORES[1] = GameDatas.INT_SAVED_SCORES[0];
            GameDatas.INT_SAVED_SCORES[0] = finisherPower;
            bRankChanged = true;
        }
        else if (GameDatas.INT_SAVED_SCORES[1] < finisherPower)
        {
            GameDatas.INT_SAVED_SCORES[2] = GameDatas.INT_SAVED_SCORES[1];
            GameDatas.INT_SAVED_SCORES[1] = finisherPower;
            bRankChanged = true;
        }
        else if (GameDatas.INT_SAVED_SCORES[2] < finisherPower)
        {
            GameDatas.INT_SAVED_SCORES[2] = finisherPower;
            bRankChanged = true;
        }

        if (bRankChanged)
        {
            TransText rankedText = finisherScoreText.transform.FindChild("Got Rank Text").GetComponent <TransText>();
            rankedText.text.text = GameDatas.STRING_SCORE_RANKED;
            rankedText.ChangeScale(0.25f, 1.00f);
        }
    }