﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using HutongGames.PlayMaker.Actions;
using HutongGames.PlayMaker;
using Tooltip = HutongGames.PlayMaker.TooltipAttribute;

namespace Bayat.SaveSystem.PlayMaker
{

    [ActionCategory(SaveSystemAction.ActionCategoryName)]
    [Tooltip("Clears the storage.")]
    public class SaveSystemClearAction : SaveSystemSettingsAction
    {

        public override void OnReset()
        {
        }

        public override void Enter()
        {
            if (this.settingsPreset)
            {
                SaveSystemAPI.ClearAsync(this.settingsPreset.CustomSettings).ContinueWith(HandleTask);
            }
            else
            {

                SaveSystemAPI.ClearAsync().ContinueWith(HandleTask);
            }
        }

    }

}