Why SaveTasks method don't save in .json? using System.Collections.Generic;
using System.IO;
using UnityEngine;

public static class DataBase
{
    private const string filePath = "tasks.json";

    private static NAME_1 tasks;

    static DataBase()
    {
        tasks = LoadTasks();
        
    }

    private static NAME_1 LoadTasks()
    {
        NAME_1 taskList = new NAME_1();

        if (File.Exists(filePath))
        {
            string json = File.ReadAllText(filePath);
            if (!string.IsNullOrEmpty(json))
            {
                taskList = JsonUtility.FromJson>(json);
            }
        }
        else
        {
            SaveTasks();
        }

        return taskList;
    }

    private static void SaveTasks()
    {
        string json = JsonUtility.ToJson(tasks);
        File.WriteAllText(filePath, json);
        
    }

    public static void AddTask(Task task)
    {
        tasks.Add(task);
        SaveTasks();
    }

    public static void RemoveTask(Task task)
    {
        tasks.Remove(task);
        SaveTasks();
    }

    public static NAME_1 GetTasks()
    {
        return tasks;
    }
} There should be exactly 2 paragraphs separated by the markdown divider: ***.
user