| | 1 | | using UnityEngine; |
| | 2 | |
|
| | 3 | | namespace DCL |
| | 4 | | { |
| | 5 | | public static class DataStore_ECS7_Extensions |
| | 6 | | { |
| | 7 | | public static void AddPendingResource(this DataStore_ECS7 self, string sceneId, object model) |
| | 8 | | { |
| 62 | 9 | | if (self.pendingSceneResources.TryGetValue(sceneId, out BaseRefCountedCollection<object> pendingResoruces)) |
| | 10 | | { |
| 52 | 11 | | pendingResoruces.IncreaseRefCount(model); |
| 52 | 12 | | } |
| | 13 | | else |
| | 14 | | { |
| 10 | 15 | | BaseRefCountedCollection<object> newCountedCollection = new BaseRefCountedCollection<object>(); |
| 10 | 16 | | newCountedCollection.IncreaseRefCount(model); |
| 10 | 17 | | self.pendingSceneResources.Add(sceneId, newCountedCollection); |
| | 18 | | } |
| 10 | 19 | | } |
| | 20 | |
|
| | 21 | | public static void RemovePendingResource(this DataStore_ECS7 self, string sceneId, object model) |
| | 22 | | { |
| 111 | 23 | | if (self.pendingSceneResources.TryGetValue(sceneId, out BaseRefCountedCollection<object> pendingResoruces)) |
| | 24 | | { |
| 105 | 25 | | pendingResoruces.DecreaseRefCount(model); |
| | 26 | | } |
| 111 | 27 | | } |
| | 28 | |
|
| | 29 | | public static void AddShapeReady(this DataStore_ECS7 self, long entityId, GameObject gameObject) |
| | 30 | | { |
| 42 | 31 | | self.shapesReady.AddOrSet(entityId, gameObject); |
| 42 | 32 | | } |
| | 33 | |
|
| | 34 | | public static void RemoveShapeReady(this DataStore_ECS7 self, long entityId) |
| | 35 | | { |
| 52 | 36 | | if (self.shapesReady.ContainsKey(entityId)) |
| 41 | 37 | | self.shapesReady.Remove(entityId); |
| 52 | 38 | | } |
| | 39 | | } |
| | 40 | | } |