예제 #1
0
    //private AIModes hive;
    // Start is called before the first frame update
    void Start()
    {
        routineNeeded = true;
        //Checks if the this is the first time the player is playing the game to show the tutorial
        if (PlayerPrefs.GetInt("firstTime") == 1)
        {
            tutorialShow.SetActive(true);
        }
        else
        {
            tutorialShow.SetActive(false);
        }
        InvokeRepeating("updateGraph", 2.0f, 1f);//Repeats the function to refresh the graph at a rate of 1 second
        if (!PlayerPrefs.HasKey("rentDays"))
        {
            PlayerPrefs.SetInt("rentDays", 4);
        }


        clock  = GetComponent <timerScript>();
        task   = GetComponent <taskManager>();
        player = GameObject.Find("Player").GetComponent <PlayerMovement>();
        if (!PlayerPrefs.HasKey("bankBalance"))
        {
            PlayerPrefs.SetFloat("bankBalance", 0.0f);
        }

        performanceSlider.maxValue = 100;
        //Retrieves the player's performance
        performanceSlider.value = PlayerPrefs.GetInt("performanceManager");
    }