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
- A 404 page is opened when selecting "Open Documentation" on the Float Node in Shader Graph
- Shader Graph Importer's Documentation Reference button leads to a 404 page
- Crash on WriteParticleLineVertex when particle systems are rendered in a specific project
- Asset names longer than the allowed system file path are not handled gracefully
- Moving VFX Particles leave a ghosting trial in Ray Traced Screen Space Reflections
Add comment