Exemplo n.º 1
0
    // Called 1st
    // Initialization
    private void Start()
    {
        string temp_saveFile;

        switch (s_currentLoadOption)
        {
        case eLoadOption.SAVE:
            temp_saveFile = SaveManager.SAVE_DATA_FILE_NAME;
            break;

        case eLoadOption.CHECKPOINT:
            temp_saveFile = SaveManager.CHECKPOINT_SAVE_DATA_FILE_NAME;
            break;

        default:
            Debug.LogError($"Unhandled enum option {s_currentLoadOption} of type {typeof(eLoadOption).Name}");
            temp_saveFile = "";
            break;
        }

        // Load a save if save data exists
        if (SaveManager.CheckIfPreviousSaveExists(temp_saveFile))
        {
            SaveManager.LoadGame(temp_saveFile);
        }

        ResetLoadOption();
    }
Exemplo n.º 2
0
 private void OnEnable()
 {
     // When the menu is opened, set if the button should be interactable or not
     loadButton.interactable = SaveManager.CheckIfPreviousSaveExists(SaveManager.CHECKPOINT_SAVE_DATA_FILE_NAME);
 }
Exemplo n.º 3
0
 // Called 1st
 // Initialization
 private void Start()
 {
     loadGameButton.interactable = SaveManager.CheckIfPreviousSaveExists();
 }