Search Unity

  1. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

After 4.3.3, the output display strange info when load new scene.

Discussion in 'Windows' started by sigmadruid, Jan 15, 2014.

  1. sigmadruid

    sigmadruid

    Joined:
    Dec 28, 2013
    Posts:
    21
    Hi everyone,

    Our game is to publish in WP8 platform. I upgraded my Unity to 4.3.3 this afternoon. After this, whenever I run the game(maybe especially when the game loads a new scene), there are countless strange message displayed in the output of VS2012. They are something like this below:

    Incorrectly unloaded MonoBehaviour class 'UIAnchor' in prefab 'b_BackgroundCenter' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    While the output keep on saying these, the game lag heavily. What's wrong? Has something to do with 4.3.3?

    Any help is appreciated!!
     
    Last edited: Jan 15, 2014
  2. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,628
    Can you post the player log? Also, are you running debug configuration by any chance? Which Unity version did you upgrade from?

    When you upgraded Unity version, did you rebuilt the project cleanly (as in not on top of visual studio solution built with older version of Unity)?
     
  3. sigmadruid

    sigmadruid

    Joined:
    Dec 28, 2013
    Posts:
    21
    Build from '' branch, version is '4.3.3f1 (c8ca9b6b9936)' (Release build).
    Physical memory: 1912 MB, commited memory limit: 570 MB.
    PlayerConnection initialized from C:/Data/Programs/{2FCCC7D2-EE02-4F72-BED5-

    5C05BC761D13}/Install/Data (debug = 0)
    PlayerConnection initialized network socket : 0.0.0.0 55221
    Multi-casting "[IP] 192.168.0.111 [Port] 55221 [Flags] 2 [Guid] 244502440 [EditorId] 4219120905

    [Version] 1048832 [Id] WP8Player(192.168.0.111) [Debug] 0" to [225.0.0.222:54997]...
    Direct3D:
    Version: Direct3D 11.0 [level 9.3]
    Renderer: Qualcomm Adreno 330 (WDDM v1.2) (ID=0x46363432)
    Vendor: Qualcomm
    VRAM: 350 MB
    Initialize engine version: 4.3.3f1 (c8ca9b6b9936)
    item type error at row981

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    item type error at row1181

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    CheckUpdate C:/Data/Users/DefApps/AppData/{2FCCC7D2-EE02-4F72-BED5-5C05BC761D13}/Local

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    Resource Version : 0

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    GET check_update
    params:
    channel=10001
    platform=ios
    client_version=9
    resource_version=0
    env=dev

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    Gzip

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    GET check_update
    { "status": "up-to-date"}

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    Incorrectly unloaded MonoBehaviour class 'PlayIdleAnimations' in prefab 'shan_gui_bei_qi' during

    GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour

    directly instead of the game object or other component.

    (Filename:

    C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp

    Line: 658)

    Incorrectly unloaded MonoBehaviour class 'PlayIdleAnimations' in prefab 'gu' during

    GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour

    directly instead of the game object or other component.

    (Filename:

    C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp

    Line: 658)

    Incorrectly unloaded MonoBehaviour class 'uv' in prefab 'lun_effect' during

    GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour

    directly instead of the game object or other component.

    (Filename:

    C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp

    Line: 658)

    Incorrectly unloaded MonoBehaviour class 'uv' in prefab 'ma_tou_qin_effect' during

    GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour

    directly instead of the game object or other component.

    (Filename:

    C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp

    Line: 658)

    Incorrectly unloaded MonoBehaviour class 'PlayIdleAnimations' in prefab 'mie_xian_fan' during

    GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour

    directly instead of the game object or other component.

    (Filename:

    C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp

    Line: 658)

    Incorrectly unloaded MonoBehaviour class 'PlayIdleAnimations' in prefab 'dizi' during

    GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour

    directly instead of the game object or other component.

    (Filename:

    C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp

    Line: 658)

    Unloading 7 Unused Serialized files (Serialized files now loaded: 0 / Dirty serialized files: 0)

    Unloading 42 unused Assets to reduce memory usage. Loaded Objects now: 1165. Operation took

    306.876862 ms.
    System memory in use: 12.0 MB.
    UnloadTime: 9.004739 ms
    SpawnPool MenuPlayerAIPool: Initializing..

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    SpawnPool MenuPlayerAIPool: Preloading 5 MenuPlayerAI

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.Transform

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.NavMeshAgent

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    CharacterGenerator

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    MenuPlayerAI

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    XCharacterInfo

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UIShowPlayerName

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.Transform

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.MeshFilter

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.MeshRenderer

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.Transform

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.MeshFilter

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.MeshRenderer

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.Transform

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.MeshFilter

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.MeshRenderer

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.Transform

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.MeshFilter

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.MeshRenderer

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.Transform

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.Transform

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)

    UnityEngine.MeshFilter

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/WP8SupportGenerated/UnityEngineDebug.cpp

    Line: 55)
     
  4. sigmadruid

    sigmadruid

    Joined:
    Dec 28, 2013
    Posts:
    21
    These are the log content. We upgrade from 4.3.1. We didn't do the clean build.
     
  5. Tautvydas-Zilys

    Tautvydas-Zilys

    Unity Technologies

    Joined:
    Jul 25, 2013
    Posts:
    10,628
    Can you try rebuilding it cleanly?
     
  6. Tomas1856

    Tomas1856

    Unity Technologies

    Joined:
    Sep 21, 2012
    Posts:
    3,826
    Did you try switching to Master configuration? Or is that not an option?
     
  7. Sef

    Sef

    Joined:
    Jan 2, 2010
    Posts:
    20
    I have the same bug:

    Incorrectly unloaded MonoBehaviour class 'MarkLine' in prefab 'MarkLine' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    After build the game works not correctly (Release and Master configuration) : (
     
  8. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,710
  9. Sef

    Sef

    Joined:
    Jan 2, 2010
    Posts:
    20
    No.
     
  10. Sef

    Sef

    Joined:
    Jan 2, 2010
    Posts:
    20
    I fixed:

    public class MyScript: MonoBehaviour
    {
    public static MyScript_this;

    void Awake ()
    {
    _this = this;
    }
    //add code
    private void OnDestroy()
    {
    _this = null;
    }

    }

    But you can not everywhere (
     
    Last edited: Jan 17, 2014
  11. ShashankDixit

    ShashankDixit

    Joined:
    Jan 7, 2014
    Posts:
    41
    Hi there

    Even we are getting the same issue and Sef's script also couldn't fix it.

    Will appreciate if someone can point to alternate fixes. Thanks.

    Regards
    Shashank
     
  12. Aurimas-Cernius

    Aurimas-Cernius

    Unity Technologies

    Joined:
    Jul 31, 2013
    Posts:
    3,710
    Instead of setting static variable you can call DonDestroyOnLoad(object).
     
  13. ShashankDixit

    ShashankDixit

    Joined:
    Jan 7, 2014
    Posts:
    41
    Wouldn't this keep the object in memory while we don't want to keep the object in memory ?
    I mean if a scene has an object and we use DontDestroyOnLoad on that object, then its memory
    wont be freed on scene change and so keep on leaking ?

    Regards
    Shashank
     
    Last edited: Jan 21, 2014
  14. plasticYoda

    plasticYoda

    Joined:
    Aug 20, 2013
    Posts:
    62
    I'm seeing the same, and when running in release or master mode I'm seeing broken behavior.

    I get the following from the log:

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/artifacts/MetroSupportGenerated/UnityEngineDebug.cpp Line: 55)

    Incorrectly unloaded MonoBehaviour class 'UITexture' in prefab 'AppIcon' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'TweenColor' in prefab 'ButtonBackground' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UISprite' in prefab 'Background' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UIButtonOffset' in prefab 'Button' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UIButtonOffset' in prefab 'CloseButton' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UISprite' in prefab 'ButtonBackground' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UIButton' in prefab 'Button' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UIButtonSound' in prefab 'CloseButton' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UILabel' in prefab 'Label' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UIPanel' in prefab 'OtherAppsView' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UIButton' in prefab 'CloseButton' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UIButtonScale' in prefab 'CloseButton' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UIButtonScale' in prefab 'Button' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UILabel' in prefab 'titleLabel' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UIButtonMessage' in prefab 'CloseButton' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'OtherAppPanel' in prefab 'OtherAppsView' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UILabel' in prefab 'infoLabel' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UISprite' in prefab 'backdrop' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UIButtonMessage' in prefab 'Button' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UIButtonSound' in prefab 'Button' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UISprite' in prefab 'background' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.

    (Filename: C:/BuildAgent/work/d3d49558e4d408f4/PlatformDependent/WinRT/GarbageCollectSharedAssetsWinRT.cpp Line: 658)

    Incorrectly unloaded MonoBehaviour class 'UISprite' in prefab 'Background' during GarbageCollectUnusedAssets.
    The Object will be reloaded from disk, to fix this properly keep a reference to the MonoBehaviour directly instead of the game object or other component.


    I do turn various objects off/on using the NGUI setActive methods...
     
  15. plasticYoda

    plasticYoda

    Joined:
    Aug 20, 2013
    Posts:
    62
    I found the problem - there was a resource prefab I loaded at startup that was used when the user tried to connect to facebook - on Windows Store I don't do use Facebook (at the moment) so that resource was unused and as I had a static reference to it, it generated these errors when the scene changed. Removed loading it and the static reference and all those errors went away.

    Turns out my unusual behavior was related to another Facebook issue that I hadn't removed correctly.
     
  16. plasticYoda

    plasticYoda

    Joined:
    Aug 20, 2013
    Posts:
    62
    Grrr... so it still happens on a WP8 version, but now with a lot of prefabs that existed in one scene but not the next -- maybe for WP8 I need to clean out a lot of references myself when switching scenes.
     
  17. Thomas-GF

    Thomas-GF

    Joined:
    Apr 4, 2013
    Posts:
    28
    I can confirm that keeping and accessing references to objects that were destroyed due to scene load causes these errors. I also suspect it to cause random crashes. Clear those references guys ^^
     
  18. PaXLiCh

    PaXLiCh

    Joined:
    Jul 28, 2013
    Posts:
    4
    This happens when I call Destroy(someGameObject) and then call Resources.UnloadUnusedAssets
    Sometimes its crashes.
    Sometimes its shows null reference if call gameObject.SetActive(bool) and this gameObject was no active at start exception stack trace tells that error somewhere in Start method, but gameObject become active after this method.

    On scene happens something wild.
     
    Last edited: Feb 12, 2014
  19. Peter Rush

    Peter Rush

    Joined:
    Mar 25, 2013
    Posts:
    9
    Im getting this also, huge spamming of this error message on winstore builds. I only have one scene. Is there a bug report for this we can track? I have tried holding references etc but havent found anything that makes a difference.
     
  20. Peter Rush

    Peter Rush

    Joined:
    Mar 25, 2013
    Posts:
    9
    Ok, I think I have sorted out what is happening in my case.

    When Resources.UnloadUnusedAssets is called, it is failing to keep hold of certain prefab objects which had been stored a static dictionary with values consisting of a simple class which contains a pointer to the prefab. If I store the prefabs in a list<Gameobject> public nonstatic variable in a Monobehavior in the game hierarchy, they don't get unloaded and no spamming of that error occurs.

    I haven't bothered to establish whether it is being static, being a dictionary<>, or being a member of a simple non-monobehaviour-derived class is the critical issue. (but it was not enough just to make it nonstatic). I encountered a similar problem a while ago where it was using a dictionary that caused a crash on win8 after reload, but Unity eventually fixed that one after several bug reports and example programs.
     
  21. bluescrn

    bluescrn

    Joined:
    Feb 25, 2013
    Posts:
    640
    I'm seeing this same issue (WP8 only) with prefabs loaded with Resources.Load. And we're finding that loading/restarting scenes on WP8 is significantly slower than iOS/Android.

    We load an assortment of prefabs - such as enemy characters - from our 'loading screen' scene, but don't instantiate any until we're in the next scene, the game level scene.

    We're getting a whole lot of debug log spam of this particular message, and it seems to be related to these prefabs, after switching to the game level scene (We have a Resources.UnloadUnusedAssets() upon entering the game level, to flush some loading screen assets).

    What do we need to do to prevent scripts on these prefabs from being unloaded? (can we even access the scripts attached to an uninstantiated prefab, it's not something that I've ever tried...)