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
- [UI Builder] Viewport's gizmos for Margin and Padding disappear when dragging to modify the value and the cursor leaves the Spacing section
- "Multiplayer Center" window does not reflect changes made in "Other Packages" section
- Crash on D3DKMTOpenResource when capturing with RenderDoc while GPU Skinning is set to GPU(Batched)
- Editing and saving Curve changes in UI Builder window throws multiple errors in the Console
- [UI Builder] Value is not selected when left clicking on Spacing/Border Widget values
Add comment