Search Unity

LoadLevelAdditiveAsync causing weird enable/disable

Discussion in 'Scripting' started by matthew_SB, Apr 27, 2015.

  1. matthew_SB

    matthew_SB

    Joined:
    Feb 20, 2015
    Posts:
    4
    Hello,
    To resume, when loading using the LoadLevelAdditiveAsync, we are losing control of a GameObject, i.e: it enables automatically.


    To explain our problem let me first describe our loading system. We have a master scene which manages the loading and unloading of scenes. In each scene there is a black sprite on which we have animated the Fade In/Out. This animation is managed via states.

    When a scene is loaded, during the first state, the Sprite Does a Fade in (black -> transparent), thereby revealing the decor behind it. Then the Sprite is disabled before going to the next state. And in the last state, the sprite is used to perform a FadeOut( enable->transparent->black).When using the Non-Async method of loading, the Fade behaviour is a we have intended.

    But when using the Async method of loading, the first state is executed correctly, the Sprite is FadedIn and then disabled. But on the third state, for no reason, the Sprite is enabled and is black. This is not the inteneded behaviour, as the Non-Async operation confirms it.

    In the inspector the Sprite has only the Transform and SpriteRenderer component attached. Is there someway to know who is modifiying the GameObject or its components ? Or is it a bug in unity ? We are using 4.6.2f1.

    Thanks in advance

    matt
     
    Last edited: Apr 27, 2015