ProjectDDD/Assets/0.Datas/02.Scripts/GenerateGoogleSheet/Core/GoogleSheetChangeLog.cs

30 lines
724 B (Stored with Git LFS)
C#

// GoogleSheetChangeLog.cs
using System;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "GoogleSheetChangeLog", menuName = "GoogleSheet/ChangeLog", order = 0)]
public class GoogleSheetChangeLog : ScriptableObject
{
[Serializable]
public class LogEntry
{
public string Editor;
public string Timestamp;
[TextArea(5, 20)] public string JsonSnapshot;
}
[SerializeField] private List<LogEntry> _logs = new();
public List<LogEntry> Logs => _logs;
public int MaxLogs = 100;
public void AddEntry(LogEntry entry)
{
if (_logs.Count >= MaxLogs)
{
_logs.RemoveAt(0);
}
_logs.Add(entry);
}
}