Snaparazzi/Assets/Scripts/PromptList.cs

28 lines
639 B
C#
Raw Permalink Normal View History

2024-01-27 11:24:47 +00:00
using System;
using System.Collections.Generic;
using UnityEngine;
[CreateAssetMenu(fileName = "PromptList", menuName = "ScriptableObjects/Prompt List", order = 1)]
public class PromptList : ScriptableObject
{
2024-01-27 18:58:02 +00:00
public List<Prompt> prompts = new();
2024-01-27 11:24:47 +00:00
/// <summary>
/// Create a new entry with a unique ID
/// </summary>
[ContextMenu("Create Entry")]
private void CreateEntry()
{
2024-01-27 18:58:02 +00:00
Prompt temp = new()
{
id = Guid.NewGuid().ToString()
};
2024-01-27 11:24:47 +00:00
prompts.Add(temp);
}
2024-01-28 12:18:40 +00:00
public Prompt GetPromptById(string _id)
{
return prompts.Find(x => x.id == _id);
}
2024-01-27 11:24:47 +00:00
}