Conversation
…tent formatting and comments
…ssets' fix(path): correct assets directory path casing in getWorkingDirectoryAssetsPath method
…sset path resolution
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
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.
This pull request introduces significant improvements to the prefab and scene management system, focusing on robust prefab instantiation, safer cloning of game objects and components, and more flexible asset path resolution. The changes also include enhancements to serialization logic and error handling, as well as minor bug fixes and code quality improvements.
Prefab and Scene Loading Enhancements:
SceneManager::inflateGameObjectMetadataandSceneManager::loadPrefabFromPathto reliably instantiate prefabs from metadata, supporting flexible asset paths and improved error handling. Prefab loading now normalizes metadata and can resolve both absolute and assets-relative paths, with better error messages for missing or invalid prefabs. [1] [2] [3] [4]Prefab::load()to use the newSceneManager::loadPrefabFromPathmethod, simplifying prefab instantiation and ensuring consistency with the new prefab system.GameObject Cloning and Serialization Improvements:
GameObject::__clone()method to deeply clone all serializable component state, ensuring prefab instances do not share mutable state. Added helper methods for extracting and duplicating serializable component data, and for reconstructing components for the clone.GameObject::__serialize()to always serialize the current sprite from the renderer, ensuring accurate prefab and scene state. [1] [2] [3]Component Metadata Hydration:
SceneManager::applySceneComponentMetadatato hydrate component properties: when a property expects aGameObject, string values are now interpreted as prefab paths and loaded accordingly, supporting prefab references within components.Asset Path Handling and Bug Fixes:
Assetsandassetsdirectories for scene files, improving compatibility across platforms.Other Minor Improvements:
Game::$consoleCursorto prevent uninitialized property issues.Game.php.These changes collectively make prefab usage more reliable, flexible, and maintainable, while improving the safety and predictability of game object cloning and scene loading.