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 OnLevelWasLoaded deprecation

Discussion in '5.4 Beta' started by codestage, Mar 2, 2016.

  1. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Hey

    I use OnLevelWasLoaded message in my code and I see such warning in 5.4 beta 7 console:

    But... there is no SceneManager.onSceneLoaded !
    Would be nice to see such warnings when we can properly react on them =)
     
    callen likes this.
  2. bdominguezvw

    bdominguezvw

    Joined:
    Dec 4, 2013
    Posts:
    96
    They changed SceneManager.onSceneLoaded to SceneManager.sceneLoaded in some beta.

    They need to change that warning.
     
    dentedpixel and codestage like this.
  3. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    Ah, thanks, @bdominguezvw !

    Totally forgot to check the offline docs, my bad :]
    But yeah, that warning should be corrected to avoid such forum posts in future =)
     
  4. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    663
    The thing with this, is that i am using it as a
    Code (JavaScript):
    1. function OnLevelWasLoaded(){
    2. blah blah
    3. }
    in a singleton object, so that it would do some stuff whenever a new scene is loaded.
    How do you use that now that is in the scene manager?
     
    Rodolfo-Rubens likes this.
  5. screenname_taken

    screenname_taken

    Joined:
    Apr 8, 2013
    Posts:
    663
    @Dmitriy Yukhanov Are you making a new version of your Anti-Cheat?
    It seems the Random.Seed is also deprecated and it throws warnings.
     
  6. codestage

    codestage

    Joined:
    Jul 27, 2012
    Posts:
    1,931
    @screenname_taken yeah, this is already addressed in current dev version ;)
    Thanks for the heads up anyways!
     
  7. stevenc33

    stevenc33

    Joined:
    Apr 20, 2016
    Posts:
    18
    Question. Since OnLevelWasLoaded is deperated (in 5.4b15), what should be used instead?
     
  8. virror

    virror

    Joined:
    Feb 3, 2012
    Posts:
    2,963
    Read the thread maybe?