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

Proper prefab cache #368

Merged

Conversation

LeeTwentyThree
Copy link
Member

@LeeTwentyThree LeeTwentyThree commented May 24, 2023

Changes made in this pull request

Resolves #364

  • Prefab initialization methods (GetGameObject) are now only called once
  • Cached prefabs persist throughout gameplay and are no longer deleted in less than 5 seconds after being added.

@LeeTwentyThree LeeTwentyThree marked this pull request as ready for review May 26, 2023 16:49
@LeeTwentyThree
Copy link
Member Author

Possible feature request for this issue: should there be an option for prefabs to not use the cache? I.e. the Gargantuan Leviathan which may be a lot to store in memory.

@LeeTwentyThree
Copy link
Member Author

LeeTwentyThree commented May 26, 2023

I can confirm though that this increases performance drastically when spawning great numbers of modded prefabs. This change will help cut down on a lot of performance issues from mods such as De-Extinction.

Edit: okay not really that big of a difference but it still feels more proper to do it this way...

Nautilus/Assets/ModPrefabCache.cs Show resolved Hide resolved
Nautilus/Assets/ModPrefabCache.cs Outdated Show resolved Hide resolved
@LeeTwentyThree LeeTwentyThree merged commit 4b0f9ea into SubnauticaModding:master May 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Implement proper prefab cache
2 participants