| | 1 | | using System.Collections; |
| | 2 | | using System.Collections.Generic; |
| | 3 | | using DCL; |
| | 4 | | using DCL.Controllers; |
| | 5 | | using DCL.Models; |
| | 6 | | using UnityEngine; |
| | 7 | |
|
| | 8 | | public static class DataStore_SceneBoundariesChecker_Extensions |
| | 9 | | { |
| | 10 | | public static void Add(this DataStore_SceneBoundariesChecker self,IDCLEntity entity, IOutOfSceneBoundariesHandler ha |
| | 11 | | { |
| 67 | 12 | | if (!self.componentsCheckSceneBoundaries.TryGetValue(entity.entityId, out HashSet<IOutOfSceneBoundariesHandler> |
| 65 | 13 | | self.componentsCheckSceneBoundaries.Add(entity.entityId,new HashSet<IOutOfSceneBoundariesHandler>() { handle |
| | 14 | | else |
| 2 | 15 | | handlersList.Add(handler); |
| 2 | 16 | | } |
| | 17 | |
|
| | 18 | | public static void Remove(this DataStore_SceneBoundariesChecker self,IDCLEntity entity, IOutOfSceneBoundariesHandler |
| | 19 | | { |
| 68 | 20 | | if (!self.componentsCheckSceneBoundaries.TryGetValue(entity.entityId, out HashSet<IOutOfSceneBoundariesHandler> |
| 60 | 21 | | return; |
| | 22 | |
|
| 8 | 23 | | if (handlersList.Count <= 1) |
| 8 | 24 | | self.componentsCheckSceneBoundaries.Remove(entity.entityId); |
| | 25 | | else |
| 0 | 26 | | handlersList.Remove(handler); |
| 0 | 27 | | } |
| | 28 | | } |