using UnityEngine; namespace DuloGames.UI { public class UITalentDatabase : ScriptableObject { #region singleton private static UITalentDatabase m_Instance; public static UITalentDatabase Instance { get { if (m_Instance == null) m_Instance = Resources.Load("Databases/TalentDatabase") as UITalentDatabase; return m_Instance; } } #endregion public UITalentInfo[] talents; /// /// Get the specified TalentInfo by index. /// /// Index. public UITalentInfo Get(int index) { return (talents[index]); } /// /// Gets the specified TalentInfo by ID. /// /// The TalentInfo or NULL if not found. /// The talent ID. public UITalentInfo GetByID(int ID) { for (int i = 0; i < this.talents.Length; i++) { if (this.talents[i].ID == ID) return this.talents[i]; } return null; } } }