| | 1 | | using DCL.Components; |
| | 2 | | using System; |
| | 3 | | using System.Collections; |
| | 4 | | using System.Collections.Generic; |
| | 5 | | using System.Linq; |
| | 6 | | using UnityEngine; |
| | 7 | |
|
| | 8 | | [CreateAssetMenu(menuName = "Variables/SmartItemParameterFactory", fileName = "SmartItemParameterFactory", order = 0)] |
| | 9 | | public class SmartItemParameterFactory : ScriptableObject |
| | 10 | | { |
| | 11 | | [Serializable] |
| | 12 | | public class Entry |
| | 13 | | { |
| | 14 | | public SmartItemParameter.ParameterType type; |
| | 15 | | public SmartItemUIParameterAdapter prefab; |
| | 16 | | } |
| | 17 | |
|
| | 18 | | [SerializeField] private Entry[] entries; |
| | 19 | |
|
| | 20 | | public SmartItemUIParameterAdapter GetPrefab(SmartItemParameter.ParameterType type) |
| | 21 | | { |
| 0 | 22 | | SmartItemUIParameterAdapter adapter = entries.FirstOrDefault(x => x.type == type)?.prefab; |
| 0 | 23 | | return adapter; |
| | 24 | | } |
| | 25 | | } |