Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Dismiss Notice

Problem with multiple scenes in hierarchy

Discussion in 'Editor & General Support' started by mrgohut, Jan 13, 2016.

  1. mrgohut

    mrgohut

    Joined:
    Feb 8, 2014
    Posts:
    134
  2. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    639
    Hi,

    Not really sure what is going on, can you file a bug report with a project and steps to reproduce.

    Thanks
     
  3. mrgohut

    mrgohut

    Joined:
    Feb 8, 2014
    Posts:
    134
    Before i do that, maybe i'm doing something wrong.
    Code (csharp):
    1.  
    2. void OnApplicationQuit()
    3.     {
    4.         StopNetwork();
    5.     }
    6. void StopNetwork()
    7.     {
    8.         if (isServer)
    9.         {
    10.             isServer = false;
    11.             isHost = false;
    12.             StopServer();
    13.         }
    14.         else if (isHost)
    15.         {
    16.             isHost = false;
    17.             isServer = false;
    18.             StopHost();
    19.         }
    20.         else
    21.         {
    22.             isHost = false;
    23.             isServer = false;
    24.             StopClient();
    25.         }
    26.     }
    27.  
    isHost and isServer are bools defined above this code. It's in NetworkManager.
    Code (csharp):
    1. void OnApplicationQuit()
    is problem here, coz when i remove it, everything is fine.
     
  4. SteenLund

    SteenLund

    Unity Technologies

    Joined:
    Jan 20, 2011
    Posts:
    639
    I don't know, hard to tell.
     
  5. Bryarey

    Bryarey

    Joined:
    Aug 24, 2014
    Posts:
    23
    Got the same when tryed to load scene in OnDestroy(). It called at game stop, so scenes still loaded in editor after game stoped. So it same as instantiate something in OnDestroy(). Maybe, some of your Stop...() methods contains scene loading operation, and in this case OnApplicationQuit is similar to OnDestroy.