| | 1 | | using System; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using DCL.Controllers; |
| | 4 | | using DCL.ECS7.UI; |
| | 5 | | using DCL.ECSRuntime; |
| | 6 | | using DCL.Models; |
| | 7 | | using UnityEngine; |
| | 8 | | using UnityEngine.UIElements; |
| | 9 | | using Random = UnityEngine.Random; |
| | 10 | |
|
| | 11 | | namespace DCL.ECSComponents |
| | 12 | | { |
| | 13 | | public class UITextComponentHandler : IECSComponentHandler<PBUiText> |
| | 14 | | { |
| | 15 | | private readonly IUIDataContainer uiDataContainer; |
| | 16 | |
|
| 0 | 17 | | public UITextComponentHandler(IUIDataContainer dataContainer) |
| | 18 | | { |
| 0 | 19 | | this.uiDataContainer = dataContainer; |
| 0 | 20 | | } |
| | 21 | |
|
| | 22 | | public void OnComponentCreated(IParcelScene scene, IDCLEntity entity) |
| | 23 | | { |
| 0 | 24 | | } |
| | 25 | |
|
| | 26 | | public void OnComponentRemoved(IParcelScene scene, IDCLEntity entity) |
| | 27 | | { |
| 1 | 28 | | uiDataContainer.RemoveUIText(scene,entity); |
| 1 | 29 | | } |
| | 30 | |
|
| | 31 | | public void OnComponentModelUpdated(IParcelScene scene, IDCLEntity entity, PBUiText model) |
| | 32 | | { |
| 1 | 33 | | uiDataContainer.AddUIComponent(scene,entity, model); |
| 1 | 34 | | } |
| | 35 | | } |
| | 36 | | } |