示例#1
0
    void Start()
    {
        myPlayer = FindObjectOfType <Player>();

        if (FindObjectOfType <GameSettingsManager>() != null)
        {
            scoreMultiplier  = GameSettingsManager.GetScoreMultiplier();
            playerDifficulty = GameSettingsManager.GetDifficultyString();
        }
        else
        {
            // Call when play from level straight from editor!
            Debug.Log("No GameSettingsManager script exists. Setting to default diffculty.");
            scoreMultiplier  = 1.0f;
            playerDifficulty = "Default";
        }

        scoreText.text = playerScore.ToString();
    }