| | 1 | | using System; |
| | 2 | | using DCL.Controllers; |
| | 3 | | using DCL.ECS7.InternalComponents; |
| | 4 | | using DCL.ECSRuntime; |
| | 5 | | using DCL.Models; |
| | 6 | |
|
| | 7 | | public class InternalTexturizableHandler : IECSComponentHandler<InternalTexturizable> |
| | 8 | | { |
| | 9 | | private readonly IInternalECSComponent<InternalTexturizable> thisComponent; |
| | 10 | |
|
| 7 | 11 | | public InternalTexturizableHandler(Func<IInternalECSComponent<InternalTexturizable>> componentGet) |
| | 12 | | { |
| 7 | 13 | | this.thisComponent = componentGet(); |
| 7 | 14 | | } |
| | 15 | |
|
| 5 | 16 | | public void OnComponentCreated(IParcelScene scene, IDCLEntity entity) { } |
| | 17 | |
|
| 0 | 18 | | public void OnComponentRemoved(IParcelScene scene, IDCLEntity entity) { } |
| | 19 | |
|
| | 20 | | public void OnComponentModelUpdated(IParcelScene scene, IDCLEntity entity, InternalTexturizable model) |
| | 21 | | { |
| 13 | 22 | | if (model.renderers.Count == 0) |
| | 23 | | { |
| 1 | 24 | | thisComponent.RemoveFor(scene, entity); |
| | 25 | | } |
| 13 | 26 | | } |
| | 27 | | } |