(WIP) Make adressables great again #1494#1500
Open
rohitkulkarni97 wants to merge 204 commits intoRE-SS3D:developfrom
Open
(WIP) Make adressables great again #1494#1500rohitkulkarni97 wants to merge 204 commits intoRE-SS3D:developfrom
rohitkulkarni97 wants to merge 204 commits intoRE-SS3D:developfrom
Conversation
…eters in asset creation methods, and removing DatabaseAsset.cs usage.
….Get method instead of DatabaseAsset's Prefab property, Create, Get<T>() & CreateAs<T>(...) functions, and different implicit operators.
…Creator and DatabaseScriptWriter for consistency in asset management workflow.
…, and Item to use Assets.Get method for improved consistency and clarity
…to use Assets.Get method for improved consistency
…and other places to streamline asset retrieval
…agement consistency
…tepCraftable, and Item to simplify usage of Assets.Get method
…nce to streamline addressable asset handling and improve code clarity
…nstructionHologramManager to utilize WorldObjectAssetReference for improved asset retrieval
…bjectsSO prefabs to enhance asset management
…eferences throughout the codebase for consistency
…proved readability
…AssetReference, and implement IEqualityComparer for improved comparison
…lementation and simplifying equality and hash code methods
…eters in asset creation methods, and removing DatabaseAsset.cs usage.
….Get method instead of DatabaseAsset's Prefab property, Create, Get<T>() & CreateAs<T>(...) functions, and different implicit operators.
…Creator and DatabaseScriptWriter for consistency in asset management workflow.
…, and Item to use Assets.Get method for improved consistency and clarity
…to use Assets.Get method for improved consistency
…and other places to streamline asset retrieval
…agement consistency
The custom event accessors forwarded directly to ActiveProvider, which is null until async initialization completes. ScriptableObjects like NetworkObjects subscribe in OnEnable before that, so their handlers were silently discarded. Replace pass-through accessors with plain static events and relay from the provider once it is created.
NetworkBarrier.Instance used a fragile self-managing singleton pattern. The barrier is now owned by AssetSubSystem, which instantiates and spawns it after both the asset system and FishNet server are ready. This fixes the barrier's GameObject remaining inactive because it was being spawned before FishNet's server had started.
Serialized prefabs that are directly embedded (non-addressable) were not being initialized at runtime. Add an Initialize pass in OnEnable that calls InitializePrefab for any already-loaded slots.
Prevents addressable NetworkObjects from being spawned on a client until its late-join preload session has completed, ensuring prefabs are registered in NetworkObjects before FishNet attempts instantiation.
The generator now sets every prefab's NetworkObserver to UseManager (except NetworkBarrier which keeps IgnoreManager) so the PreloadCondition from ObserverManager is applied at spawn time.
PreloadSession now stores the NetworkConnection so TryFinalizePreloadSession can call RebuildObservers when the session succeeds, allowing gated addressable objects to spawn.
…ng serialization, call it from Awake or Start instead.
…nceLifetimeTracker
The check was dead code (typed AssetHandle guarantees a NetworkObject) and contained a bug that would NullReferenceException on instance.Dispose.
Every class that held an AssetHandle had its own private ReleaseHandle method doing the same dispose-and-null dance. Consolidate into a single static AssetHandle.Release<T> and update all call sites.
…access Equals, GetHashCode, and GenerateHash were accessing the backing field directly, which could return 0 on clients where the hash hasn't been generated yet. Route all access through the Hash property.
The sync Load() call blocked the main thread while Addressables needed it to complete, causing a deadlock. Extract the RPC body into an async void helper that properly awaits LoadAsync().
Use AssetSubSystem.Has() for synchronous validation, then delegate to an async void helper that properly awaits both LoadAsync() and SpawnAsync(), eliminating two GetAwaiter().GetResult() deadlocks.
All callers have been converted to use LoadAsync(). The sync wrapper using GetAwaiter().GetResult() deadlocked on Unity's main thread when Addressables needed it to complete the load.
Rename LocalPlayerSpawnItemInFirstHandAvailable to async variant and update PlaymodeTestRepository to yield the Task properly, removing the last usage of the sync Load() path.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
PR checklist
Pictures/Videos
Testing
Networking checklist
Changes
Related issues/PRs