Files
unity-application/Assets/Common/Interfaces/ThemeList.cs
2023-03-19 17:37:50 +00:00

30 lines
767 B
C#

using System.Collections.Generic;
using UnityEngine;
/// <summary>
/// Keep track off defined themes
/// </summary>
[CreateAssetMenu(menuName = "Create new Scriptable/ThemeList")]
public class ThemeList : ScriptableObject
{
/// <summary>
/// Index of the active/to be loaded/current theme
/// </summary>
public int currentThemeIndex = 0;
/// <summary>
/// List of all defined themes
/// </summary>
public List<Theme> themes = new List<Theme>();
/// <summary>
/// Function to find a theme-index in the list based on its index
/// </summary>
/// <param name="title"></param>
public void SetCurrentTheme(ThemeIndex index)
{
this.currentThemeIndex = themes.FindIndex((mi) => mi.index == index);
}
}