コード例 #1
0
ファイル: GameBonus.cs プロジェクト: pmosoft/CrazyWord
    public IEnumerator BonusGameEnded()
    {
        Debug.Log("BonusGameEnded");

        //--------------------
        // State && Init
        //--------------------
        g.isGameBonus   = false;
        g.isGameTurning = false;

        gameComponent.DestroyGridChildrens();

        gameState.StateBonusGameEnded();

        g.turnDelayTime = 2.5f;


        //------------------------
        // Effect Letter
        //------------------------
        if (int.Parse(gameComponent.wordCntUILabel.text) > 0)
        {
            gameComponent.bonusEndUILabel.text = "Mission Fail!!";
        }

        gameComponent.bonusEndScale.from     = Vector3.one * 6f;
        gameComponent.bonusEndScale.to       = Vector3.one * 1.2f;
        gameComponent.bonusEndScale.duration = 1.2f;
        gameComponent.bonusEndScale.enabled  = true;
        gameComponent.bonusEndScale.ResetToBeginning();

        if (int.Parse(gameComponent.wordCntUILabel.text) > 0)
        {
            gameBasic.PlayTTS("Mission");
            yield return(new WaitForSeconds(0.7f));

            gameBasic.PlayTTS("Fail");
            yield return(new WaitForSeconds(0.5f));

            gameComponent.bonusEndUILabel.text = "Mission Fail!!";
        }
        else
        {
            gameBasic.PlayTTS("Mission");
            yield return(new WaitForSeconds(0.7f));

            gameBasic.PlayTTS("Complete");
            yield return(new WaitForSeconds(0.5f));

            g.bonusCnt++;

            gameComponent.rankUIScrollBar.barSize = (float)(g.curStageScore + g.bonusScore) / (float)g.curStageVitualMaxScore;
        }


        //FadeInOutPanel.SetActive(false);

        //------------------------
        // Modify Panel
        //------------------------
        // Modify Widget Size
        Vector3 v3 = gameState.WordCnt.transform.localPosition;

        v3 = new Vector3(-224, v3.y, v3.z);           //-224 --> -237
        gameComponent.wordCntUISprite.width     = 90; // 90-->130
        gameComponent.clickWordUILabel.fontSize = 60; // 60-->45
        // Modify TimeSlider
        gameComponent.EndTimeSliderSprite.spriteName   = "bomb";
        gameComponent.StartTimeSliderSprite.spriteName = "bombflame";

        //------------------------
        // Next Panel
        //------------------------
        gameState.BonusGameEnd.SetActive(false);
        yield return(new WaitForSeconds(1.0f));

        StartCoroutine(gameControl.StageMaster());
    }