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
- [Android] The Player freezes when disabling Bluetooth while connected to the headphones
- Addressable bundles are not retrieved from the cache when a WebGL Player is refreshed
- Sprites are incorrectly occluded by Sprite Physics Shape culling when behind in sorting order
- CPU usage is increased when the Editor is idle with the ProBuilder Package installed
- Unstable lighting when additional light sources are added in Shader Graph nodes
Add comment