Search Issue Tracker
Fixed in 5.5.0
Votes
0
Found in
5.0.0f1
Issue ID
670937
Regression
No
EditorApplication.currentScene returns an empty string on the opened scene when building
To reproduce:
1) Create new project
2) Create a few scenes in it (for example, "A", "B", "C")
3) Make Assets/Editor folder and add this script in there:
using UnityEngine;
using UnityEditor;
using UnityEditor.Callbacks;
using System.Collections;
public class UnityPostprocess {
[PostProcessScene]
public static void OnPostprocessScene() {
Debug.Log(EditorApplication.currentScene);
}
}
4) Add all the scenes in build order (for example, ordered like ABC)
5) Open a new scene
6) Build the project. Notice in console how it prints out scenes in order ABCA
7) Open scene "A"
8) Build the project again. Notice that this time the scenes are printed in the same order but instead of "A" scene's path, there is an empty string printed out
9) Open scene "B"
10) Build the project again. This time B scene's call returns no path
All about bugs
View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.
Latest issues
- An “Assertion failed on expression” error is thrown when building an AssetBundle and two assets have the same name
- Real delta time is different than deltaTime and uscaledDeltaTimeFixed when using multiple monitors with different refresh frequencies set in Windows options
- Persisted event listeners are reset when collapsing and expanding a component in the Inspector
- Floating Material Preview window has a burger icon button that does nothing when pressed
- TreeView drag and drop operation is not cancelled when a modal opens over it
Add comment