Hello Guest

Show Posts

This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.


Topics - Jonathans

Pages: [1]
1
I'm currently working with Unity 5.5.0p1 and 2DToolkit 2.4.0. My problem is when i'm switching between scenes, the game crashes approximately 10% of the time. The crash is caused by a call to Resources.UnloadUnusedAssets().

I'm using a lot of SpriteCollections and SpriteAnimator in the game. And i don't know is it's important, but the crash occurs on the PS4 platform.

I narrow down every possible cause to this, so i'm pretty sure the problem is during loading/unloading textures with tk2d.

Maybe you already faced this issue?


Here's a code sample of the function called between scenes:

IEnumerator DeferredUnload()
    {
        //Clear static caches
        AudioManager.ClearAudioCaches();
        PeriodicDamageOnCollision.ClearDamageMemory();
        GameUtil.CurrencyManager.RefreshCurrencyCache();

        yield return new WaitForSeconds(0.1f);

        AsyncOperation unload = Resources.UnloadUnusedAssets();
        while (!unload.isDone) // wait to unload unused assets before GC
        {
            yield return null;
        }

        System.GC.Collect(System.GC.MaxGeneration, System.GCCollectionMode.Forced);

        yield return new WaitForSeconds(0.5f);

        _loadEmptyScene = false;
        _forceLoadingOperation = null;
        _GC_CoroutineStarted = false;
        TransitionCompleteIn(null);

        _isLevelReady = false;
    }

And the call stack from the PS4 Platform:

Il2CppUserAssemblies.prx!<no symbols>+0x88143
Il2CppUserAssemblies.prx!<no symbols>+0x88784
eboot.bin!UnloadUnusedAssetsOperation::IntegrateMainThread()+0x15cc
eboot.bin!PreloadManager::UpdatePreloadingSingleStep(PreloadManager::UpdatePreloadingFlags, int)+0x245
eboot.bin!PreloadManager::UpdatePreloading()+0x17a
eboot.bin!UNITY_main(void*)+0x4378
eboot.bin!main+0x25a5
eboot.bin!_start+0x3f

Pages: [1]