| | 1 | | using System.Collections.Generic; |
| | 2 | | using DCL.Controllers; |
| | 3 | |
|
| | 4 | | namespace DCL |
| | 5 | | { |
| | 6 | | public static class PortableExperienceUtils |
| | 7 | | { |
| | 8 | | public static List<GlobalScene> GetActivePortableExperienceScenes() |
| | 9 | | { |
| 0 | 10 | | List<GlobalScene> activePortableExperienceScenes = new List<GlobalScene>(); |
| 0 | 11 | | IWorldState worldState = Environment.i.world.state; |
| | 12 | |
|
| 0 | 13 | | foreach (var globalSceneId in worldState.globalSceneIds) |
| | 14 | | { |
| 0 | 15 | | if (worldState.TryGetScene(globalSceneId, out GlobalScene scene)) |
| | 16 | | { |
| 0 | 17 | | if (scene.isPortableExperience) |
| | 18 | | { |
| 0 | 19 | | activePortableExperienceScenes.Add(scene); |
| | 20 | | } |
| | 21 | | } |
| | 22 | | } |
| | 23 | |
|
| 0 | 24 | | return activePortableExperienceScenes; |
| | 25 | | } |
| | 26 | |
|
| | 27 | | public static List<string> GetActivePortableExperienceIds() |
| | 28 | | { |
| 0 | 29 | | List<string> currentSceneAndPortableExperiencesIds = new List<string>(); |
| 0 | 30 | | IWorldState worldState = Environment.i.world.state; |
| | 31 | |
|
| 0 | 32 | | foreach (var globalSceneId in worldState.globalSceneIds) |
| | 33 | | { |
| 0 | 34 | | if (worldState.TryGetScene(globalSceneId, out GlobalScene scene)) |
| | 35 | | { |
| 0 | 36 | | if (scene.isPortableExperience) |
| | 37 | | { |
| 0 | 38 | | currentSceneAndPortableExperiencesIds.Add(globalSceneId); |
| | 39 | | } |
| | 40 | | } |
| | 41 | | } |
| | 42 | |
|
| 0 | 43 | | return currentSceneAndPortableExperiencesIds; |
| | 44 | | } |
| | 45 | | } |
| | 46 | | } |