void Awake()
    {
        LocalizationBase  = LocalizationBase.FindObjectOfType <LocalizationBase>();
        HaterPlateManager = HaterPlateManager.FindObjectOfType <HaterPlateManager>();
        ButtonAudio       = GetComponent <AudioSource> ();
        AmbientAudio      = GameObject.Find("GameSceneController/AmbientMusic").GetComponent <AudioSource> ();

        playerMusicSetting    = PlayerPrefs.GetInt("PlayerMusicSetting");
        playerSoundSetting    = PlayerPrefs.GetInt("PlayerSoundSetting");
        playerLanguageSetting = PlayerPrefs.GetInt("PlayerLanguageSetting");
        playerLevelNumber     = PlayerPrefs.GetInt("PlayerLevelNumber");
        if (PlayerPrefs.HasKey("PlayerScore"))
        {
            playerScore = PlayerPrefs.GetInt("PlayerScore");
        }

        if (playerScore == 0)
        {
            playerScore = playerScore + Mathf.FloorToInt(levelsMaxScores [playerLevelNumber] * 0.15f);
        }
        if (playerLevelNumber == 0)
        {
            MinExpValue = 0;
        }
        else
        {
            MinExpValue = Mathf.FloorToInt(playerScore * 0.8f);
        }

        UpdateSaves();
    }
Пример #2
0
    void Awake()
    {
        LocalizationBase    = LocalizationBase.FindObjectOfType <LocalizationBase> ();
        GameSceneController = GameSceneController.FindObjectOfType <GameSceneController> ();
        HaterPlateManager   = HaterPlateManager.FindObjectOfType <HaterPlateManager> ();

        HaterAudio = GetComponent <AudioSource>();
        HaterSetType();
        BusterHater();
        if (!IsBoss)
        {
            haterCurrentExp = Random.Range(Mathf.FloorToInt(haterMaxExp * 0.15f), Mathf.FloorToInt(haterMaxExp * 0.85f));
            haterCurrentHp  = Random.Range(Mathf.FloorToInt(haterMaxHp * 0.3f), Mathf.FloorToInt(haterMaxHp * 1f));
        }
        else
        {
            SetSelebrity();
        }
        haterExpSlider.maxValue = haterMaxExp;
        haterHpSlider.maxValue  = haterMaxHp;
        UpdateHaterFraze();
        UpdateHaterName();
        UpdateText();
    }