Exemplo n.º 1
0
    public IEnumerator ShowBonusGameRule()
    {
        Debug.Log("ShowBonusGameRule");

        //--------------------
        // Init
        //--------------------
        gameState.StateGameLevel("bonus");
        gameState.StateMemoryGamePanel();


        wordCnt2 = 0;
        gameComponent.gameSceneBgUITexture.color = Color.gray;

        gameComponent.gameIconUISprite.spriteName = "speedgameicons";
        //gameComponent.gameIconUISprite.MakePixelPerfect();


        //--------------------
        // State
        //--------------------
        g.isGameTexture = true;
        gameState.StateBonusGame();
        gameHint.HintLetterEffectAllStop();

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

        gameState.WordCnt.transform.localPosition = new Vector3(-237, v3.y, v3.z); //-224 --> -237
        gameComponent.wordCntUISprite.width       = 130;                           // 90-->120
        gameComponent.clickWordUILabel.fontSize   = 45;                            // 60-->50

        //--------------------------------------------
        // BonusGameRule
        //--------------------------------------------
        int alphabat1;
        int alphabat2;
        int alphabat3;

        gameComponent.clickWordUILabel.text = "BonusTime";

        bonusTextCnt = Random.Range(bonusTextMinLength, bonusTextMaxLength);


        //---------------------------------------------
        // Instantiate Tile
        //---------------------------------------------
        gameBasic.InitTile(5, 5, LetterPrefab);
        gameBasic.SetLetter();

        gameComponent.EnableGridBoxCollider(false);



        //Debug.Log(g.letterExcluded[0].ToString());
        //Debug.Log(g.letterExcluded[1].ToString());
        //Debug.Log(g.letterExcluded[2].ToString());
        //Debug.Log(g.letterExcluded[3].ToString());
        //Debug.Log(g.letterExcluded[4].ToString());
        //Debug.Log(g.letterExcluded[5].ToString());

        bonusWordText = g.letterExcluded[Random.Range(0, 25)].ToString();



        //alphabat1 = Random.Range(65,89);
        //alphabat2 = Random.Range(65,89);
        //while(alphabat1==alphabat2) alphabat2 = Random.Range(65,89);
        //alphabat3 = Random.Range(65,89);
        //while(alphabat1==alphabat3 || alphabat2==alphabat3) alphabat3 = Random.Range(65,89);

        //bonusWordText = System.Convert.ToChar(alphabat1).ToString();
        //if(bonusTextCnt==2) {
        //    bonusWordText += System.Convert.ToChar(alphabat2).ToString();
        //} else if (bonusTextCnt==3) {
        //    bonusWordText += System.Convert.ToChar(alphabat2).ToString();
        //    bonusWordText += System.Convert.ToChar(alphabat3).ToString();
        //}

        bonusAllWord = "";
        for (int i = 1; i <= bonusTouchCnt; i++)
        {
            bonusAllWord += bonusWordText;
        }

        //Debug.Log("bonusAllWord="+bonusAllWord);

        gameComponent.bonusRuleTouchLabel.text = "[ff0000]" + bonusWordText + "[-]";
        gameComponent.bonusRuleCountLabel.text = "[315bc1]" + bonusTouchCnt.ToString() + "[-]";
        gameComponent.bonusRuleTimeLabel.text  = "[009900]" + g.bonusLimitTime.ToString() + "[-]";

        //--------------------
        // setting limitTime
        //--------------------
        g.limitTime = (int)(g.limitBaseTime * g.bonusLimitTime);
        gameComponent.limitUILabel.text     = g.limitTime.ToString();
        gameComponent.limitLineUILabel.text = g.limitTime.ToString();

        gameComponent.wordCntUILabel.text = bonusTouchCnt.ToString();

        //Debug.Log("gameComponent.wordCntUILabel.text=" + gameComponent.wordCntUILabel.text);

        Color frameCol = g.GetRandomColor();

        gameComponent.gameTextureUISprite.color  = frameCol;
        gameComponent.pictureFrameUISprite.color = frameCol;


        //--------------------
        // fade in
        //--------------------
        yield return(StartCoroutine(navi.FadeIn()));

        //--------------------
        // CountDown
        //--------------------
        for (int i = 53; i > 47; i--)
        {
            if (g.isGameTexture)
            {
                gameComponent.bonusRuleReadyLabel.text = "[ff0000]" + System.Convert.ToChar(i).ToString() + "[-]";
                yield return(new WaitForSeconds(0.5f));

                BonusRuleShowTime++;
            }
        }

        if (g.isGameTexture)
        {
            BonusGameStart();
        }
        //StartCoroutine ( BonusGameStart() );
    }
Exemplo n.º 2
0
    public IEnumerator ShowTexture()
    {
        Debug.Log("ShowTexture");

        //---------------------------------------------
        // Set State
        //---------------------------------------------
        g.isGameTexture      = true;
        g.isCombo            = true;
        g.isShowLetterEffect = true;
        //gameComponent.EnableGameSceneButtonBoxCollider(false);
        gameState.StateShowTexture();
        gameComponent.bannerHintUILabel.text = "- HINT -";

        //---------------------------------------------
        // BoxCollider
        //---------------------------------------------

        gameComponent.comboGameBoxCollider.enabled = true;
        gameComponent.hardGameBoxCollider.enabled  = true;
        gameComponent.easyGameBoxCollider.enabled  = true;

        gameComponent.mapBottomBoxCollider.enabled = true;

        //---------------------------------------------
        // Initiate Variable
        //---------------------------------------------
        gameComponent.wordCntUILabel.text = g.texShowName.Length.ToString();

        gameComponent.gameIconUISprite.spriteName = "imagegameicons";
        //gameComponent.gameIconUISprite.MakePixelPerfect();

        gameComponent.comboGameAnimator.SetBool("isButtonWiggle", true);

        gameComponent.gameTextureUISprite.color  = Color.white;
        gameComponent.pictureFrameUISprite.color = Color.white;


        //---------------------------------------------
        // Setting random Backgroud
        //---------------------------------------------
        if (g.stageTurn > 1)
        {
            gameBasic.SetBackgroudColor();
        }
        //---------------------------------------------
        // Setting random Texture
        //---------------------------------------------
        if (g.stageTurn > 1)
        {
            SetTurnTexture();
        }
        //gameComponent.clickWordUILabel.text = g.texShowName;
        gameComponent.clickWordUILabel.text = "";

        //---------------------------------------------
        // Setting Banner
        //---------------------------------------------

        _data          = dbo.SelTextureInfo(g.curStage, g.texName); dr = _data.Rows[0];
        g.texTTSName   = dr["texShowName"].ToString();
        g.texStateName = dr["meaning"].ToString();

        //---------------------------------------------
        // FadeIn
        //---------------------------------------------
        if (g.stageTurn > 1)
        {
            yield return(StartCoroutine(navi.FadeIn()));
        }

        //---------------------------------------------
        // Navigation
        //---------------------------------------------
        if (g.isGameTexture)
        {
            StartCoroutine(ShowCorrectLetter());
        }
    }