Resolve WES-80 "Data"
This commit is contained in:
39
Assets/Common/Interfaces/ThemeList.cs
Normal file
39
Assets/Common/Interfaces/ThemeList.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System.Collections;
|
||||
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 title
|
||||
/// </summary>
|
||||
/// <param name="title"></param>
|
||||
public void SetCurrentTheme(string title)
|
||||
{
|
||||
this.currentThemeIndex = themes.FindIndex((mi) => mi.title == title);
|
||||
}
|
||||
|
||||
/// <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);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user