Exemplo n.º 1
0
    private bool loaded;            //if the scene is loading - make it true so wont load again

    // Use this for initialization
    void Start()
    {
        Time.timeScale  = 1;
        savePlayerStats = GameObject.Find("SavePlayerStats");
        dialogueManager = GameObject.Find("Dialogue Manager");
        InventoryScript.ClearInventory();
        if (savePlayerStats != null)
        {
            Destroy(savePlayerStats);
        }
        if (dialogueManager != null)
        {
            Destroy(dialogueManager);
        }
        Cursor.visible   = true;
        Cursor.lockState = CursorLockMode.None;

        if (File.Exists(Application.dataPath + "/SaveGame.dat"))
        {
            loadCahapterButton.GetComponent <Button> ().interactable = true;
        }
        else
        {
            loadCahapterButton.GetComponent <Button> ().interactable = false;
        }
        if (File.Exists(Application.dataPath + "/SaveGameAtSavePoint.dat"))
        {
            loadSavePointButton.GetComponent <Button> ().interactable = true;
        }
        else
        {
            loadSavePointButton.GetComponent <Button> ().interactable = false;
        }
        StartCoroutine(ChangeEventSystem());
    }