Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: portable experiences #1354

Merged
merged 156 commits into from
Sep 13, 2024
Merged
Show file tree
Hide file tree
Changes from 149 commits
Commits
Show all changes
156 commits
Select commit Hold shift + click to select a range
18a820a
First steps
fcolarich Jun 27, 2024
b940c4d
Added more logic for PX
fcolarich Jul 1, 2024
bc6c2ec
Merge branch 'main' into feat/portable_experiences
fcolarich Jul 2, 2024
6e3dcf6
temp changes to test
fcolarich Jul 2, 2024
be5e502
Merge branch 'feat/portable_experiences' of https://github.com/decent…
fcolarich Jul 2, 2024
8e2fe2a
Fixed error during merge of restricted actions changes
fcolarich Jul 2, 2024
ebb5b54
Several fixes related to SceneDefinitionComponent
fcolarich Jul 7, 2024
5152a88
Update ECSWorldFactory.cs
fcolarich Jul 7, 2024
bc8d82a
Fixed proper Disposal of PXs
fcolarich Jul 10, 2024
acb330b
Added PX to disposal of world in RealmController
fcolarich Jul 10, 2024
970a27b
cleanp
fcolarich Jul 10, 2024
6621577
Many changes to API
fcolarich Jul 11, 2024
cce71da
Added missing ens utils
fcolarich Jul 11, 2024
21e2daa
Fixed issues with assembly definitions + moved files around
fcolarich Jul 13, 2024
c2cf5a9
Implemented missing APIs for PX
fcolarich Jul 14, 2024
c6d5f98
Merge branch 'main' into feat/portable_experiences
fcolarich Jul 14, 2024
8fb395e
Update PortableExperiencesController.cs
fcolarich Jul 14, 2024
ee19c67
Fix for disposal of scenes
fcolarich Jul 14, 2024
f5ad83b
Fixed API and js code
fcolarich Jul 15, 2024
c2113a4
Fixed test and added missing disposal in wrapper
fcolarich Jul 15, 2024
8065c8e
Merge branch 'main' into feat/portable_experiences
NickKhalow Jul 15, 2024
fcd7566
Applied code review suggestions
fcolarich Jul 16, 2024
d824e4c
fix for reuse of RealmData
fcolarich Jul 16, 2024
749fcc9
More PR recommendations
fcolarich Jul 16, 2024
5d4769b
added new classes for sidebar + integrated all UI elements into a mai…
fcolarich Jul 18, 2024
88b47a1
Merge branch 'main' into feat/sidebar_implementation
fcolarich Jul 18, 2024
81d4bf1
Update DCL.Plugins.asmdef
fcolarich Jul 18, 2024
d614098
Merge branch 'main' into feat/portable_experiences
fcolarich Jul 18, 2024
8447c28
Changed animations for buttons + more
fcolarich Jul 18, 2024
d0c28a3
Added more functionality to buttons & UI
fcolarich Jul 18, 2024
c7b83d1
Added notifications indicator
fcolarich Jul 19, 2024
f081314
Moved emote opener to MainUI sidebar
fcolarich Jul 19, 2024
164d0bc
Fixed issue with closing sidebar
fcolarich Jul 19, 2024
93ceb4a
Improved hideshow view
fcolarich Jul 19, 2024
3578301
Fixes for sidebar and container
fcolarich Jul 19, 2024
d132f30
Update MainUIContainer.prefab
fcolarich Jul 19, 2024
302bc06
Added base structure for notitifactions panel
davidejensen Jul 19, 2024
2b994ef
Bound notifications button to notifications panel
davidejensen Jul 19, 2024
50c06d1
Added image caching for notifications infinite scroll
davidejensen Jul 22, 2024
0f658e0
Added read/unread status of notifications
davidejensen Jul 22, 2024
0c3d49a
Small tweaks to animations to remove glitch when switching scene cards
fcolarich Jul 22, 2024
7652f51
Fixed notifications read status
davidejensen Jul 22, 2024
aefe26b
Wired notification time span
davidejensen Jul 22, 2024
7e563ab
Minor changes to notifications logic
davidejensen Jul 23, 2024
2771df8
Merge branch 'main' into feat/sidebar_implementation
davidejensen Jul 24, 2024
e428895
Added cleaned up logic and links to buttons
fcolarich Jul 24, 2024
4b624f0
Added zooming + scaling + beating animation to new pin
fcolarich Jul 24, 2024
1b02042
Merge branch 'main' into feat/sidebar_implementation
davidejensen Jul 25, 2024
c078d90
Several changes for Pin markers
fcolarich Jul 25, 2024
4ce2b03
changed logic for showing side bar
davidejensen Jul 25, 2024
9254fa6
Changed how many of the systems work and how map path is setup
fcolarich Jul 25, 2024
4191b77
Added calculations for minimap
fcolarich Jul 26, 2024
61f014d
Fixes to minimap calculations
fcolarich Jul 26, 2024
7258024
Added logic for calculating arrival to destination
fcolarich Jul 26, 2024
a03c5c8
Streamlined code from minimap
fcolarich Jul 26, 2024
898dfb3
Small tweaks to line renderer
fcolarich Jul 26, 2024
8902f03
Merge branch 'main' into feat/sidebar_implementation
fcolarich Jul 26, 2024
d842c65
Fixed notification logic missing
fcolarich Jul 26, 2024
51847da
Update Global Plugins Settings.asset
fcolarich Jul 26, 2024
d87c504
Merge branch 'main' into feat/portable_experiences
fcolarich Jul 26, 2024
4876b6b
Update PortableExperienceSceneFacade.cs
fcolarich Jul 26, 2024
eb20429
Update Main.unity
fcolarich Jul 26, 2024
0357185
Merge branch 'feat/sidebar_implementation' into feat/goto_map_pin
fcolarich Jul 26, 2024
70bb9fb
Update Main.unity
fcolarich Jul 26, 2024
77dc9bf
Added destination set popup
fcolarich Jul 26, 2024
786bf3c
Fixed issue with navmap
fcolarich Jul 26, 2024
05f65e5
Minor fixes
davidejensen Jul 29, 2024
7860fec
Minor fixes
davidejensen Jul 29, 2024
0aa0fff
Merge branch 'main' into feat/sidebar_implementation
davidejensen Jul 29, 2024
634b2c2
Applied fixes from uber branch
fcolarich Jul 29, 2024
d94376a
Cleanup of classes and small tweaks
fcolarich Jul 29, 2024
1172060
Added notifications click in notifiations panel
davidejensen Jul 30, 2024
c8e871b
Added sidebar bus
davidejensen Jul 30, 2024
beddc28
Refactored MainUI/Sidebar logic into plugins and proper MVC flow
fcolarich Jul 30, 2024
38f698c
Added logic for sidebar autohide
fcolarich Jul 30, 2024
5bd4b3f
tweaks to autotoggle
fcolarich Jul 30, 2024
ceba90f
fix to sidebar detection area
fcolarich Jul 30, 2024
fc9e59a
Extracted AnimationHashes into its own UIAnimationHashes to remove de…
fcolarich Jul 31, 2024
a378209
Merge branch 'main' into feat/goto_map_pin
davidejensen Jul 31, 2024
6934d60
Merge branch 'main' into feat/sidebar_implementation
fcolarich Jul 31, 2024
3143028
Merge branch 'feat/sidebar_implementation' into feat/goto_map_pin
fcolarich Jul 31, 2024
6c452c8
Fixed post merge conflicts
fcolarich Jul 31, 2024
2a552f6
Added destination reached notification + asmdef improvements to avoid…
davidejensen Jul 31, 2024
221d92d
Minor naming fix
davidejensen Jul 31, 2024
fa356ab
Fixed issues with SidebarProfileWidget
fcolarich Jul 31, 2024
a1c4ca6
Fixed autohide logic
fcolarich Jul 31, 2024
9023787
Addressed most PR comments
fcolarich Jul 31, 2024
0501165
Merge branch 'feat/sidebar_implementation' into feat/goto_map_pin
davidejensen Jul 31, 2024
953efda
Fixed notifications button sidebar animation
davidejensen Jul 31, 2024
b9fd843
Updated animation to use dotween
davidejensen Jul 31, 2024
203b80e
Merge branch 'main' into feat/sidebar_implementation
davidejensen Jul 31, 2024
9389966
Merge branch 'feat/sidebar_implementation' into feat/goto_map_pin
davidejensen Jul 31, 2024
f08a33c
Minor fix for tests
davidejensen Jul 31, 2024
e4fb43a
Merge branch 'main' into feat/sidebar_implementation
davidejensen Jul 31, 2024
84bbfc3
Minor ui fixes
davidejensen Jul 31, 2024
df3dca5
Merge branch 'feat/sidebar_implementation' into feat/goto_map_pin
fcolarich Aug 1, 2024
3cc15a6
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 2, 2024
aafdd4c
Merge branch 'feat/goto_map_pin' into feat/portable_experiences
fcolarich Aug 2, 2024
3a00a67
Revert "Merge branch 'feat/goto_map_pin' into feat/portable_experiences"
fcolarich Aug 5, 2024
55f6a66
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 5, 2024
a4992f2
Fixes after merge
fcolarich Aug 5, 2024
08206cd
Removed API classes for PX and moved logic into Wrapper
fcolarich Aug 5, 2024
3b2e97a
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 5, 2024
76ee2ad
Added logic to make map pins load only on PXs
fcolarich Aug 5, 2024
60b4131
Some fixes from PR
fcolarich Aug 5, 2024
993f165
Cleanup of PXSceneFacade
fcolarich Aug 5, 2024
83e2372
cleanup from PR comments
fcolarich Aug 5, 2024
2163d45
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 6, 2024
4a772c8
Cleanup of scene geometry calculation for PXs
fcolarich Aug 7, 2024
39a9eca
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 7, 2024
fc85442
Tweaks to PX logic
fcolarich Aug 7, 2024
0c9fbe1
Merge branch 'feat/portable_experiences' of https://github.com/decent…
fcolarich Aug 7, 2024
1a44a17
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 9, 2024
d0df40b
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 12, 2024
07fed72
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 13, 2024
939c1e4
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 13, 2024
44e1359
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 14, 2024
348ca78
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 14, 2024
3954812
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 14, 2024
4751e19
Many fixes related to PX disposal
fcolarich Aug 15, 2024
0dd5656
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 15, 2024
158eaff
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 15, 2024
b8a50ba
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 19, 2024
1034bf2
Use of new EnsExtensions to avoid allocations + cleanup
fcolarich Aug 19, 2024
c0b4b4d
Fixes from PR
fcolarich Aug 20, 2024
b511410
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 20, 2024
299b5e2
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 30, 2024
5de3ad3
Small tweaks after merge
fcolarich Aug 30, 2024
6bd594d
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 30, 2024
c757ed0
Merge branch 'main' into feat/portable_experiences
fcolarich Aug 30, 2024
a0d9046
Added support for Feature flags
fcolarich Sep 2, 2024
9dcc773
Merge branch 'main' into feat/portable_experiences
fcolarich Sep 5, 2024
1757429
Fixed post merge broken things
fcolarich Sep 5, 2024
f0235c3
Merge branch 'main' into feat/portable_experiences
fcolarich Sep 9, 2024
7a1af72
Renamed flags
fcolarich Sep 9, 2024
dc29bef
Corrected Feature Flags implementation
fcolarich Sep 9, 2024
b67aec9
Merge branch 'main' into feat/portable_experiences
fcolarich Sep 9, 2024
05ed346
Added debug setting to enable/disable remote PX from loading
fcolarich Sep 9, 2024
13c1917
Added chat support to load portable experiences
fcolarich Sep 9, 2024
cee46bd
Added kill px chat command and fixed load command
fcolarich Sep 10, 2024
529f438
added switch to main thread
fcolarich Sep 10, 2024
d297ea7
Added logic to support loading any world as px
fcolarich Sep 10, 2024
309ab03
Merge branch 'main' into feat/portable_experiences
fcolarich Sep 10, 2024
6e12426
Added logic to disable PX chat commands by feature flag
fcolarich Sep 10, 2024
9fc212f
Fixed test
fcolarich Sep 10, 2024
8f6cc71
Added proper enum for feature flags
fcolarich Sep 10, 2024
7d89854
Merge branch 'main' into feat/portable_experiences
fcolarich Sep 11, 2024
b25adf1
Update DCL.InputModifier.Systems.asmref.meta
fcolarich Sep 11, 2024
f89998d
Merge branch 'main' into feat/portable_experiences
fcolarich Sep 11, 2024
33b11a9
Fixes to chat commands
fcolarich Sep 12, 2024
9b3a6aa
Added some checks and extracted methods for loading PX during loading
fcolarich Sep 13, 2024
a153154
Replaced method with SuppressAnyExceptionWithFallback
fcolarich Sep 13, 2024
667fdb8
Improved clarity of feature flag checks
fcolarich Sep 13, 2024
c8b242a
Merge branch 'main' into feat/portable_experiences
fcolarich Sep 13, 2024
3d9f475
Added missing flag to enum for map pin icons
fcolarich Sep 13, 2024
9268d0c
Replaced Enum with feature flags with static readonly strings
fcolarich Sep 13, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions Explorer/Assets/DCL/CommunicationData/URLHelpers/ENS.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
using DCL.CommunicationData.URLHelpers;
using System;

namespace CommunicationData.URLHelpers
{
public readonly struct ENS
{
private readonly string ens;

public ENS(string ens)
{
this.ens = ens;
}

public bool IsValid => !string.IsNullOrEmpty(ens) && ens.IsEns();

public bool Equals (ENS other) => Equals(other.ens);

public bool Equals(string other) =>
string.Equals(ens, other, StringComparison.OrdinalIgnoreCase);

public override string ToString() => ens;
}
}

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ namespace DCL.CommunicationData.URLHelpers
public static class EnsExtensions
{
private static readonly Regex REGEX = new (@"^[a-zA-Z0-9.]+\.eth$");
private const string WORLD_URL = "https://worlds-content-server.decentraland.org/world/";

public static bool IsEns(this string str) =>
REGEX.Match(str).Success;

public static bool IsEns(this URLDomain domain) =>
REGEX.Match(domain.Value).Success;

public static string ConvertEnsToWorldUrl(this ENS ens) =>
WORLD_URL + ens.ToString().ToLower();
}
}
25 changes: 25 additions & 0 deletions Explorer/Assets/DCL/FeatureFlags/FeatureFlagsConfiguration.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,33 @@

namespace DCL.FeatureFlags
{
public enum FeatureFlags
{
PORTABLE_EXPERIENCE,
GLOBAL_PORTABLE_EXPERIENCE,
PORTABLE_EXPERIENCE_CHAT_COMMANDS,
MAP_PINS
}

public class FeatureFlagsConfiguration
{
public static string GetFlag(FeatureFlags flags)
{
switch (flags)
{
case FeatureFlags.PORTABLE_EXPERIENCE:
return "alfa-portable-experiences";
fcolarich marked this conversation as resolved.
Show resolved Hide resolved
case FeatureFlags.GLOBAL_PORTABLE_EXPERIENCE:
return "alfa-global-portable-experiences";
case FeatureFlags.PORTABLE_EXPERIENCE_CHAT_COMMANDS:
return "alfa-portable-experiences-chat-commands";
case FeatureFlags.MAP_PINS:
return "alfa-map-pins";
default:
return flags.ToString();
}
}

private readonly FeatureFlagsResultDto result;

public FeatureFlagsConfiguration(FeatureFlagsResultDto result)
Expand Down
3 changes: 2 additions & 1 deletion Explorer/Assets/DCL/Ipfs/SceneMetadata.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ public class SceneMetadata : PreserveOriginalJson
public List<string> allowedMediaHostnames;
public List<string> requiredPermissions;
public List<SpawnPoint>? spawnPoints;
public bool isPortableExperience;

[Serializable]
public struct SpawnPoint
Expand All @@ -38,7 +39,7 @@ public Vector3 ToVector3() =>
}

/// <summary>
/// Coordinates is either a single value or a list of values
/// Coordinates is either a single value or a list of values
/// </summary>
[JsonConverter(typeof(SpawnPointCoordinateConverter))]
public struct Coordinate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,8 @@ private void AddSceneVisualState(in Entity entity, ref PartitionComponent partit
if (!partition.IsDirty) return;

if (partition.OutOfRange) return;
VisualSceneState visualSceneState = new VisualSceneState();

var visualSceneState = new VisualSceneState();
visualSceneStateResolver.ResolveVisualSceneState(ref visualSceneState, partition, sceneDefinitionComponent, lodSettingsAsset, realmData);
visualSceneState.IsDirty = false;
World.Add(entity, visualSceneState);
Expand Down
6 changes: 4 additions & 2 deletions Explorer/Assets/DCL/LOD/Systems/UpdateSceneLODInfoSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@
using DCL.Diagnostics;
using DCL.LOD.Components;
using DCL.Multiplayer.Connections.DecentralandUrls;
using DCL.Optimization.PerformanceBudgeting;
using DCL.PluginSystem.Global;
using ECS.Abstract;
using ECS.LifeCycle.Components;
using ECS.Prioritization.Components;
Expand Down Expand Up @@ -46,7 +48,7 @@ protected override void Update(float t)
}

[Query]
[None(typeof(DeleteEntityIntention))]
[None(typeof(DeleteEntityIntention), typeof(PortableExperienceComponent))]
private void UpdateLODLevel(ref SceneLODInfo sceneLODInfo, ref PartitionComponent partitionComponent, SceneDefinitionComponent sceneDefinitionComponent)
{
if (!partitionComponent.IsBehind) // Only want to load scene in our direction of travel
Expand Down Expand Up @@ -89,7 +91,7 @@ private byte GetLODLevelForPartition(ref PartitionComponent partitionComponent,
sceneLODCandidate = (byte)(i + 1);
}

//LOD0 load distance may be very far away from its show distance depending on the object size.
//LOD0 load distance may be very far away from its show distance depending on the object size.
//So, we force it if it has not been loaded and we passed the show distance threshold
if (sceneLODInfo.metadata.LODChangeRelativeDistance >= partitionComponent.Bucket * ParcelMathHelper.PARCEL_SIZE
&& sceneLODCandidate == 1 && !sceneLODInfo.HasLOD(0))
Expand Down
57 changes: 29 additions & 28 deletions Explorer/Assets/DCL/LOD/Systems/UpdateVisualSceneStateSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,14 @@
using DCL.Diagnostics;
using DCL.LOD;
using DCL.LOD.Components;
using DCL.Optimization.PerformanceBudgeting;
using ECS.Abstract;
using ECS.LifeCycle.Components;
using ECS.Prioritization.Components;
using ECS.SceneLifeCycle.Components;
using ECS.SceneLifeCycle.SceneDefinition;
using ECS.StreamableLoading.Common;
using SceneRunner;
using SceneRunner.Scene;
using System.Runtime.CompilerServices;

Expand All @@ -20,21 +22,20 @@ namespace ECS.SceneLifeCycle.Systems
[LogCategory(ReportCategory.LOD)]
public partial class UpdateVisualSceneStateSystem : BaseUnityLoopSystem
{
/// <summary>
/// Represents one of the methods in UpdateVisualSceneStateSystem, they should be converted to static ones to avoid closures
/// </summary>
private delegate void ContinuationMethod<T>(Entity entity, ref VisualSceneState visualSceneState, ref SceneDefinitionComponent sceneDefinitionComponent, ref PartitionComponent partitionComponent, ref T switchComponent);

private readonly IRealmData realmData;
private readonly IScenesCache scenesCache;
private readonly ILODCache lodCache;
private readonly ILODSettingsAsset lodSettingsAsset;
private readonly SceneAssetLock sceneAssetLock;

private static readonly QueryDescription VISUAL_STATE_SCENE_QUERY = new QueryDescription()
.WithAll<VisualSceneState, PartitionComponent, SceneDefinitionComponent>()
.WithAny<SceneLODInfo, ISceneFacade, AssetPromise<ISceneFacade, GetSceneFacadeIntention>>()
.WithNone<DeleteEntityIntention>();

/// <summary>
/// Represents one of the methods in UpdateVisualSceneStateSystem, they should be converted to static ones to avoid closures
/// </summary>
private delegate void ContinuationMethod<T>(Entity entity, ref VisualSceneState visualSceneState, ref SceneDefinitionComponent sceneDefinitionComponent, ref PartitionComponent partitionComponent, ref T switchComponent);
.WithNone<DeleteEntityIntention, PortableExperienceComponent>();

private readonly ContinuationMethod<ISceneFacade> sceneFacadeToLODContinuation;
private readonly ContinuationMethod<AssetPromise<ISceneFacade, GetSceneFacadeIntention>> scenePromiseToLODContinuation;
Expand Down Expand Up @@ -98,9 +99,10 @@ private void IterateOverOneOf<T>(Archetype archetype, ContinuationMethod<T> cont

foreach (int entityIndex in chunk)
{
ref SceneDefinitionComponent sceneDefinitionComponent = ref Unsafe.Add(ref scenedefinitioncomponentFirstElement, entityIndex);
ref readonly Entity entity = ref Unsafe.Add(ref entityFirstElement, entityIndex);
ref VisualSceneState visualSceneStateComponent = ref Unsafe.Add(ref visualscenestateFirstElement, entityIndex);
ref SceneDefinitionComponent sceneDefinitionComponent = ref Unsafe.Add(ref scenedefinitioncomponentFirstElement, entityIndex);

ref T customComponent = ref Unsafe.Add(ref customComponentFirstElement, entityIndex);
ref PartitionComponent partitionComponent = ref Unsafe.Add(ref partitioncomponentFirstElement, entityIndex);

Expand All @@ -118,18 +120,17 @@ private void IterateOverOneOf<T>(Archetype archetype, ContinuationMethod<T> cont

private void SwapScenePromiseToLOD(Entity entity, ref VisualSceneState visualSceneState, ref SceneDefinitionComponent sceneDefinitionComponent, ref PartitionComponent partitionComponent, ref AssetPromise<ISceneFacade, GetSceneFacadeIntention> switchcomponent)
{
if (visualSceneState.CurrentVisualSceneState == VisualSceneStateEnum.SHOWING_LOD)
{
var sceneLODInfo = SceneLODInfo.Create();
if (visualSceneState.CurrentVisualSceneState != VisualSceneStateEnum.SHOWING_LOD) return;

//Dispose Promise
switchcomponent.ForgetLoading(World);
var sceneLODInfo = SceneLODInfo.Create();

visualSceneState.IsDirty = false;
//Dispose Promise
switchcomponent.ForgetLoading(World);

World.Add(entity, sceneLODInfo);
World.Remove<AssetPromise<ISceneFacade, GetSceneFacadeIntention>>(entity);
}
visualSceneState.IsDirty = false;

World.Add(entity, sceneLODInfo);
World.Remove<AssetPromise<ISceneFacade, GetSceneFacadeIntention>>(entity);
}

private void SwapLODToScenePromise(Entity entity, ref VisualSceneState visualSceneState, ref SceneDefinitionComponent sceneDefinitionComponent, ref PartitionComponent partitionComponent, ref SceneLODInfo switchComponent)
Expand All @@ -143,26 +144,26 @@ private void SwapLODToScenePromise(Entity entity, ref VisualSceneState visualSce
World.Add(entity, AssetPromise<ISceneFacade, GetSceneFacadeIntention>.Create(World,
new GetSceneFacadeIntention(realmData.Ipfs, sceneDefinitionComponent),
partitionComponent));

World.Remove<SceneLODInfo>(entity);
}
}

private void SwapSceneFacadeToLOD(Entity entity, ref VisualSceneState visualSceneState, ref SceneDefinitionComponent sceneDefinitionComponent, ref PartitionComponent partitionComponent, ref ISceneFacade switchComponent)
{
if (visualSceneState.CurrentVisualSceneState == VisualSceneStateEnum.SHOWING_LOD)
{
//Create LODInfo
var sceneLODInfo = SceneLODInfo.Create();
if (visualSceneState.CurrentVisualSceneState == VisualSceneStateEnum.SHOWING_LOD)
{
//Create LODInfo
var sceneLODInfo = SceneLODInfo.Create();

//Dispose scene
switchComponent.DisposeSceneFacadeAndRemoveFromCache(scenesCache, sceneDefinitionComponent.Parcels, sceneAssetLock);
//Dispose scene
switchComponent.DisposeSceneFacadeAndRemoveFromCache(scenesCache, sceneDefinitionComponent.Parcels, sceneAssetLock);

visualSceneState.IsDirty = false;
visualSceneState.IsDirty = false;

World.Add(entity, sceneLODInfo);
World.Remove<ISceneFacade, AssetPromise<ISceneFacade, GetSceneFacadeIntention>>(entity);
World.Add(entity, sceneLODInfo);
World.Remove<ISceneFacade, AssetPromise<ISceneFacade, GetSceneFacadeIntention>>(entity);
}
}
}

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ public void SetUp()
cachedInfo = new LODCacheInfo(lodGroupPool.Get(), 2);
cachedInfo.SuccessfullLODs = 1;
lodCache = Substitute.For<ILODCache>();

lodCache.TryGet(fakeSceneIDCached, out Arg.Any<LODCacheInfo>()).Returns(call =>
{
call[1] = cachedInfo;
Expand All @@ -55,7 +55,8 @@ public void SetUp()
}
}
};
sceneDefinitionComponent = new SceneDefinitionComponent(sceneEntityDefinition, new IpfsPath());

sceneDefinitionComponent = SceneDefinitionComponentFactory.CreateFromDefinition(sceneEntityDefinition, new IpfsPath());
partitionComponent = new PartitionComponent();
system = new InitializeSceneLODInfoSystem(world, lodCache, LOD_LEVELS, lodGroupPool,
new GameObject().transform, Substitute.For<ISceneReadinessReportQueue>(),
Expand Down Expand Up @@ -99,4 +100,4 @@ public void GotNewSceneMetadataFromCache()
Assert.AreEqual(sceneLODInfoRetrieved.metadata.FailedLODs, (byte)0);
}
}
}
}
Loading
Loading