Hello!
So, I know that in order to get the Scene Name I usually have two options:
1 - Use **UnityEditor.EditorApplication.currentScene**, which requires me to be in an Editor class (file inside an Editor folder) or to use #if UNITY_EDITOR.
2 - Use **Application.loadedLevelName**, which works fine as long as I dont use it right after creating a new scene (the first option works in this case).
The thing is Im creating a script that needs to run in edit mode and which goes into a DLL, so the use of #if UNITY_EDITOR is crossed and I dont want to create a custom inspector for every class that needs to see the Scene Name just to get the Scene Name. How can I cover the case missing in the second option?
What else can I do to solve this?
Thanks!
↧