Skip to content

fix sceneloader for build compatibility; refactor#55

Open
eioe wants to merge 3 commits into
devfrom
fix/47-sceneloader
Open

fix sceneloader for build compatibility; refactor#55
eioe wants to merge 3 commits into
devfrom
fix/47-sceneloader

Conversation

@eioe
Copy link
Copy Markdown
Member

@eioe eioe commented May 7, 2026

Fix issue at build time -> closes #47

some cosmetic refactoring / safety checks.

tested in Editor and local build. (Load() and Unload(). )

@eioe eioe requested review from Copilot and thefirstfloor May 7, 2026 12:33
@eioe eioe self-assigned this May 7, 2026
@eioe eioe added the fix Fixes a known issue. label May 7, 2026
Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes SceneLoader build compatibility by ensuring UnityEditor-only APIs are guarded behind #if UNITY_EDITOR, while also refactoring the scene load/unload logic with extra safety checks.

Changes:

  • Wrapped UnityEditor usage in #if UNITY_EDITOR and switched the editor-only reference field to SceneAsset.
  • Refactored load/unload methods to add guard clauses and handle already-loaded / unload failure cases.
  • Moved initial load behavior to call LoadScene(_sceneName) from Awake().

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Assets/com.edia.core/Runtime/Base/Scripts/Experiment/SceneLoader.cs Outdated
Comment thread Assets/com.edia.core/Runtime/Base/Scripts/Experiment/SceneLoader.cs
Comment thread Assets/com.edia.core/Runtime/Base/Scripts/Experiment/SceneLoader.cs
Comment thread Assets/com.edia.core/Runtime/Base/Scripts/Experiment/SceneLoader.cs Outdated
eioe and others added 2 commits May 7, 2026 14:44
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

fix Fixes a known issue.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

SceneLoader doesnot work in builds

3 participants