fr.jeanf.scenemanagement 0.6.21 → 0.6.22

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -147,8 +147,9 @@ namespace jeanf.scenemanagement
147
147
 
148
148
  var tempZoneList = new NativeList<FixedString128Bytes>(100, Allocator.Temp);
149
149
 
150
- foreach (var entry in precomputedBuffer)
150
+ for (var index = 0; index < precomputedBuffer.Length; index++)
151
151
  {
152
+ var entry = precomputedBuffer[index];
152
153
  switch (entry)
153
154
  {
154
155
  case { isZoneRegionMapping: true, zoneId: { IsEmpty: false }, regionId: { IsEmpty: false } }:
@@ -170,8 +171,9 @@ namespace jeanf.scenemanagement
170
171
  [BurstCompile]
171
172
  private void BuildPrecomputedCheckableZones(ref SystemState state, DynamicBuffer<PrecomputedVolumeDataBuffer> precomputedBuffer)
172
173
  {
173
- foreach (var entry in precomputedBuffer)
174
+ for (var index = 0; index < precomputedBuffer.Length; index++)
174
175
  {
176
+ var entry = precomputedBuffer[index];
175
177
  if (!entry.isHeader || entry.primaryZoneId.IsEmpty) continue;
176
178
  var tempList = new NativeList<FixedString128Bytes>(entry.count + _landingZones.Count, Allocator.Temp);
177
179
 
@@ -191,11 +193,12 @@ namespace jeanf.scenemanagement
191
193
  {
192
194
  tempList.Add(landingEnumerator.Current);
193
195
  }
196
+
194
197
  landingEnumerator.Dispose();
195
198
 
196
199
  var checkableArray = tempList.ToArray(Allocator.Persistent);
197
200
  tempList.Dispose();
198
-
201
+
199
202
  _precomputedCheckableZones.TryAdd(entry.primaryZoneId, checkableArray);
200
203
  }
201
204
  }
@@ -207,8 +210,9 @@ namespace jeanf.scenemanagement
207
210
 
208
211
  if (currentZone.IsEmpty)
209
212
  {
210
- foreach (var t in _allZones)
213
+ for (var index = 0; index < _allZones.Length; index++)
211
214
  {
215
+ var t = _allZones[index];
212
216
  _checkableZoneIds.Add(t);
213
217
  }
214
218
 
@@ -217,8 +221,9 @@ namespace jeanf.scenemanagement
217
221
 
218
222
  if (_precomputedCheckableZones.TryGetValue(currentZone, out var checkableArray))
219
223
  {
220
- foreach (var t in checkableArray)
224
+ for (var index = 0; index < checkableArray.Length; index++)
221
225
  {
226
+ var t = checkableArray[index];
222
227
  _checkableZoneIds.Add(t);
223
228
  }
224
229
  }
@@ -363,17 +368,21 @@ namespace jeanf.scenemanagement
363
368
  entities.Dispose();
364
369
  levelInfos.Dispose();
365
370
 
366
- foreach (var toLoad in _toLoadList)
371
+ for (var index = 0; index < _toLoadList.Length; index++)
367
372
  {
373
+ var toLoad = _toLoadList[index];
368
374
  var streamingData = toLoad.Item2;
369
- streamingData.runtimeEntity = SceneSystem.LoadSceneAsync(state.WorldUnmanaged, streamingData.sceneReference);
375
+ streamingData.runtimeEntity =
376
+ SceneSystem.LoadSceneAsync(state.WorldUnmanaged, streamingData.sceneReference);
370
377
  state.EntityManager.SetComponentData(toLoad.Item1, streamingData);
371
378
  }
372
379
 
373
- foreach (var toUnload in _toUnloadList)
380
+ for (var index = 0; index < _toUnloadList.Length; index++)
374
381
  {
382
+ var toUnload = _toUnloadList[index];
375
383
  var streamingData = toUnload.Item2;
376
- SceneSystem.UnloadScene(state.WorldUnmanaged, streamingData.runtimeEntity, SceneSystem.UnloadParameters.DestroyMetaEntities);
384
+ SceneSystem.UnloadScene(state.WorldUnmanaged, streamingData.runtimeEntity,
385
+ SceneSystem.UnloadParameters.DestroyMetaEntities);
377
386
  streamingData.runtimeEntity = Entity.Null;
378
387
  state.EntityManager.SetComponentData(toUnload.Item1, streamingData);
379
388
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fr.jeanf.scenemanagement",
3
- "version": "0.6.21",
3
+ "version": "0.6.22",
4
4
  "displayName": "Scene Management",
5
5
  "description": "This package contains two scene loading system, one is additive, the other is to load subscenes. \nBoth system are living side-by-side.\nThe dynamic systems handles the loading of all static content (environment) using subscenes.\nThe additive system loads scene additively depending on zone & region and upon scenario load/unload requests. Each region or scenario can have dependency that will remain loaded until either a region or a scenario became irrelevant.",
6
6
  "unity": "2021.3",