| | 1 | | using System.Collections; |
| | 2 | |
|
| | 3 | | namespace DCL.Components |
| | 4 | | { |
| | 5 | | public class UIShapeUpdateHandler<ReferencesContainerType, ModelType> : ComponentUpdateHandler |
| | 6 | | where ReferencesContainerType : UIReferencesContainer |
| | 7 | | where ModelType : UIShape.Model |
| | 8 | |
|
| | 9 | | { |
| | 10 | | private readonly UIShape<ReferencesContainerType, ModelType> uiShapeOwner; |
| | 11 | |
|
| 80 | 12 | | public UIShapeUpdateHandler(IDelayedComponent owner) : base(owner) |
| | 13 | | { |
| 80 | 14 | | uiShapeOwner = owner as UIShape<ReferencesContainerType, ModelType>; |
| 80 | 15 | | } |
| | 16 | |
|
| | 17 | | protected override IEnumerator ApplyChangesWrapper(BaseModel newModel) |
| | 18 | | { |
| 149 | 19 | | uiShapeOwner.PreApplyChanges(newModel); |
| | 20 | |
|
| 149 | 21 | | var enumerator = base.ApplyChangesWrapper(newModel); |
| | 22 | |
|
| 149 | 23 | | if (enumerator != null) |
| 149 | 24 | | yield return enumerator; |
| 149 | 25 | | } |
| | 26 | | } |
| | 27 | | } |