Quantcast
Channel: Questions in topic: "dll"
Viewing all articles
Browse latest Browse all 706

How to get Scene Name in Edit Mode without #if UNITY_EDITOR

$
0
0
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!

Viewing all articles
Browse latest Browse all 706

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>