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

Deployment Management

-

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

Add comment

Log in to post comment

All about bugs

View bugs we have successfully reproduced, and vote for the bugs you want to see fixed most urgently.