Fixed image registry

This commit is contained in:
2026-01-14 11:48:50 +00:00
parent 4a507152d5
commit c3a0e39c65
6 changed files with 43 additions and 32 deletions

View File

@@ -0,0 +1,21 @@
using UnityEngine;
namespace InterfaceOff
{
[System.Serializable] public struct ImageSet
{
[field: SerializeField] public Sprite[] Images { get; set; }
}
[CreateAssetMenu(fileName = "Image Registry", menuName = "Custom/Create Image Registry")]
public class ImageRegistry : ScriptableObject
{
[field: SerializeField] public ImageSet[] Registered { get; set; }
public Sprite[] GetRandomSpriteSet()
{
int index = Random.Range(0, Registered.Length);
return Registered[index].Images;
}
}
}