Search Unity

  1. Unity Asset Manager is now available in public beta. Try it out now and join the conversation here in the forums.
    Dismiss Notice

Scripting Regarding Application.isLoadingLevel

Discussion in '5.4 Beta' started by TheSniperFan, May 7, 2016.

  1. TheSniperFan

    TheSniperFan

    Joined:
    Jul 18, 2013
    Posts:
    712
    Hello.
    I am using Unity 5.4 and ever since the new scene manager was introduced in 5.3, Unity tells me that "UnityApplication.isLoadingLevel is obsolete." and that I should "[...] please suse LoadLevelAsync to detect if a specific scene is currently loading."
    I maintain a quite complex serialization/deserialization asset for Unity and there is a problem with that. Namely that checking LoadLevelAsync does not replace isLoadingLevel. They do not do the same thing.

    The key difference is that LoadLevelAsync requires me to have access to the part of the code where the LoadLevelAsync method is being called. I need access to wherever the developer starts loading a level. How am I supposed to do that? Yes, there are ways around that but they all boil down to the same problem: Making the usage of the asset needlessly more complicated and, potentially, create incompatibilities to other assets. I mean, I'd have to write an integrated scene manager that keeps track of the async operation. After that I would have to a) force every developer to use it and b) if others would use the same workaround, those assets would be incompatible.

    isLoadingLevel on the other hand works without me having to know and care where and how the developer calls LoadLevelAsync. It just tells me »that« Unity's internal scene loading routines are currently being executed.

    I have two questions here:
    1. Have I missed something? Is there a way around this? Have I just overlooked the replacement for isLoadingLevel?
    2. If not, would it be possible to add a proper replacement in Unity 5.4? It's nothing fancy; Just a flag that is being set at the beginning of whatever internal method LoadLevelAsync invokes and cleared just before it returns.

    tl;dr: Either I am blind or Unity is replacing functionality with something that doesn't really work as a replacement.