private IEnumerator WaitForGameStartMessage(WWW www)
    {
        yield return(www);

        if (www.error == null)
        {
            Debug.Log("WWW get Ok!: " + www.text);

            JsonData result = JsonMapper.ToObject(www.text);

            if (result["result"].ToString().Equals("1"))
            {
                //Server Response True. -> Game Start.

                if (CMainData.Dice_Count > 4)
                {
                    CMainData.Dice_Time = 0.0f;
                }

                CMainData.Dice_Count -= 1;

                CMainData.setGameMode(GameData.GAME_MODE_BLITZ);   //set game mode
                CMainData.setGameState(GameData.GAME_STATE_READY); //set game state
                Application.LoadLevel("GameScene");                //load game scene
            }
            else
            {
                //Server Response False. -> Game Start Fail.
            }

            complete    = true;
            start       = false;
            runningTime = 0.0f;

            loading.SetActive(false);
        }
        else
        {
            Debug.Log("WWW Error: " + www.error);
        }
    }
Exemple #2
0
    public void StartTutorialButton()
    {
        Debug.Log("StartTutorialButton");

        ButtonClickSound();

        /*if (DiceCheck())
         * {*/


        CMainData.setGameMode(GameData.GAME_MODE_TUTORIAL); //set game mode
        CMainData.setGameState(GameData.GAME_STATE_READY);  //set game state
        Application.LoadLevel("GameScene");                 //load game scene


        /*}
         * else
         * {
         *  shop_dice.SetActive(true);
         * }*/
    }