using System.Collections.Generic; using UnityEngine; namespace Ubisoft.Hotel.Package { public class PlayerPackageSuite : ScriptableObject { public static readonly string FILENAME = "hotelSettings"; public static PlayerPackageSuite Load() { return Resources.Load(FILENAME); } [SerializeField] private List m_properties; public List Properties { get { return m_properties; } set { m_properties = value; } } public void AddProperty(PlayerPackageProperty value) { if (Properties == null) { Properties = new List(); } Properties.Add(value); } public PlayerPackageProperty GetProperty() { PlayerPackageProperty returnValue = null; if (Properties != null) { System.Type type = typeof(T); int count = Properties.Count; for (int i = 0; i < count && returnValue == null; i++) { if (Properties[i].GetType() == type) { returnValue = Properties[i]; } } } return returnValue; } } }