29 lines
790 B
C#
29 lines
790 B
C#
using NUnit.Framework;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using UnityEngine;
|
|
|
|
namespace BrewMonster.UI
|
|
{
|
|
[CreateAssetMenu(fileName = "DialogScriptTableObject", menuName = "Scriptable Objects/DialogScriptTableObject")]
|
|
public class DialogScriptTableObject : ScriptableObject
|
|
{
|
|
public List<DialogResouce> lstPrefabDialog;
|
|
|
|
public GameObject GetPrefabDialog(string id)
|
|
{
|
|
if (string.IsNullOrEmpty(id) || lstPrefabDialog == null)
|
|
return null;
|
|
var entry = lstPrefabDialog.Find(x => !string.IsNullOrEmpty(x.id) && x.id.Equals(id));
|
|
return entry.prefab;
|
|
}
|
|
}
|
|
|
|
[Serializable]
|
|
public struct DialogResouce
|
|
{
|
|
public string id;
|
|
public GameObject prefab;
|
|
}
|
|
}
|