Exemple #1
0
    void Start()
    {
        mGameState = eGameState.Init;


        //set match data
        //FuelHandler _fuelHandlerScript = getFuelHandlerClass();

        //GameMatchData _data = _fuelHandlerScript.getMatchData();


        PropellerProduct _propellerProductScript = getPropellerProductClass();
        GameMatchData    _data = _propellerProductScript.getMatchData();


        if (_data.ValidMatchData == true)
        {
            updateYourAvatarText(_data.YourNickname);
            updateTheirAvatarText(_data.TheirNickname);
            updateMatchRoundText("Round - " + _data.MatchRound.ToString());

            GameObject _gameObj = GameObject.Find("yourAvatar");
            StartCoroutine(downloadImgX(_data.YourAvatarURL, _gameObj));

            _gameObj = GameObject.Find("theirAvatar");
            StartCoroutine(downloadImgX(_data.TheirAvatarURL, _gameObj));
        }
        else         //Single Player
        {
            updateYourAvatarText("You");
            updateTheirAvatarText("Computer");
            updateMatchRoundText("Round - X");
        }

        GameObject _backObj = GameObject.Find("backButton");

        _backObj.GetComponent <Renderer>().enabled = false;


        //Timeup Popup
        GameObject _timeup = GameObject.Find("TimeUpPopup");

        _timeup.GetComponent <Renderer>().enabled = false;
        _timeup = GameObject.Find("finalScore");
        _timeup.GetComponent <Renderer>().enabled = false;

        gameoverTimer = 0.0f;
    }
Exemple #2
0
    public void RefreshHiScore()
    {
        if (PlayerPrefs.HasKey("hiScore"))
        {
            PropellerProduct _propellerProductScript = getPropellerProductClass();
            GameMatchData    _gameMatchData          = _propellerProductScript.getMatchData();
            int score  = _gameMatchData.MatchScore;
            var _score = PlayerPrefs.GetInt("hiScore");

            if (score > _score)
            {
                _score = score;
                PlayerPrefs.SetInt("hiScore", _score);
            }

            GameObject gameObj = GameObject.Find("HiScore");
            TextMesh   t       = (TextMesh)gameObj.GetComponent(typeof(TextMesh));
            t.text = _score.ToString();
        }
    }