コード例 #1
0
    private void CalculateLevel()
    {
        int accValue = prefsControl.GetAccumalitiveMoney();

        level.text     = "Level : " + (Mathf.FloorToInt(accValue / levelIndicator) + 1).ToString();
        firePower.text = "Level : " + prefsControl.GetFirePower();
        health.text    = "Level : " + prefsControl.GetMinimumHealth();
        multipler.text = "Level : " + prefsControl.GetMinimumMultipler();
        error.gameObject.SetActive(false);
        UpdateHordingValue();
    }
コード例 #2
0
 // Use this for initialization
 void Start()
 {
     playerPrefs   = FindObjectOfType <PlayerPrefsControlScript>();
     gameScore     = playerPrefs.GetGameMoney();
     currentScore  = playerPrefs.GetCurrentGameMoney();
     currentScore += gameScore;
     earned        = GameObject.Find("Txt_GameScore").GetComponent <Text>();
     total         = GameObject.Find("Txt_CurrentGameScore").GetComponent <Text>();
     earned.text   = gameScore.ToString();
     total.text    = currentScore.ToString();
     playerPrefs.SetAccumalitiveMoney(playerPrefs.GetAccumalitiveMoney() + gameScore);
     gameScore = 0;
     playerPrefs.SetGameMoney(gameScore);
     playerPrefs.SetCurrentGameMoney(currentScore);
     evSystem = FindObjectOfType <EventSystem>();
 }