| | 1 | | using System.Collections.Generic; |
| | 2 | | using DCL.Controllers; |
| | 3 | | using DCL.Models; |
| | 4 | |
|
| | 5 | | namespace DCL.ECS7.InternalComponents |
| | 6 | | { |
| | 7 | | public static class InternalInputEventResultsExtensions |
| | 8 | | { |
| | 9 | | public static void AddEvent(this IInternalECSComponent<InternalInputEventResults> component, IParcelScene scene, |
| | 10 | | InternalInputEventResults.EventData data) |
| | 11 | | { |
| 61 | 12 | | var entityId = data.hit?.EntityId?? SpecialEntityId.SCENE_ROOT_ENTITY; |
| | 13 | |
|
| 61 | 14 | | var model = component.GetFor(scene, entityId)?.model ?? new InternalInputEventResults(new List<InternalInput |
| | 15 | |
|
| 61 | 16 | | model.events.Add(data); |
| | 17 | |
|
| 61 | 18 | | component.PutFor(scene, entityId, model); |
| 61 | 19 | | } |
| | 20 | | } |
| | 21 | | } |