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.


Messages - andrew99

Pages: [1]
1
Hi Marcin,

Apparently to lock orientations in Windows Phone (in this case the OS Keyboard) we have to set the orientation both in Unity's Player Settings, and also in the MainPage.xaml file generated in the Visual Studio Project. Inside the .xaml file there are "Orientation" and "SupportedOrientations" field which you can edit.
Hope this helps!

2
Hi Aren,

Thanks for the fast reply.
So this is an issue with Unity?
Can't be helped then, I'll try asking in the Unity forum.
Thanks again!

3
Hi

The soft keyboard orientation still behaves as if autorotation is enabled.
In Unity's Player Settings I've set the orientation to fixed (Landscape Left), and disabled the Accelerometer.
But even though the game's orientation is locked properly, the soft keyboard still rotates.
I haven't had any luck in finding any documentation which address this specific issue (perhaps my googling just sucks :P).
Apparently orientation lock issue is a thing in my QA side, so I'd really appreciate the help on how to fix this issue..

FYI, I'm using
- NGUI 3.5.1 (can't upgrade due to compatibility issues with some custom codes, but I've confirmed that this issue still happens in NGUI 3.7.4)
- Unity 4.5.4
- Visual Studio 2012 for Windows Phone Update 2

I've attached a screenshot of what the issue looks like on NGUI demo scene : Chat Window.
Hope someone can help with this. Thanks!

4
IT WORKED!!!
Adding that on the OnDisable function, and then calling Resources.UnloadUnusedAssets() in the new scene clears the textures properly
Thanks a lot Rajken & ArenMook! Has been splitting my hairs for the past few days looking for a workaround for this problem. ;D ;D

5
Didn't find UIDrawCall.ReleaseInactive() method. I'm currently using 3.0.9f2, do I need to update to f7 to call this method?
Find a ReleaseAll() method though. Tried modifying the previous script into something like
  1. public void TriggerSceneChange()
  2.         {
  3.                 UIWidget[] widgets = Resources.FindObjectsOfTypeAll<UIWidget>();
  4.                 foreach(UIWidget tmp in widgets)
  5.                 {
  6.                         Debug.Log("destroying : " + tmp.name);
  7.                         Destroy(tmp);
  8.                 }
  9.                 UIDrawCall.ReleaseAll();
  10.                 StartCoroutine(unload());
  11.         }
  12.  
After changing scene, the unused atlas is still there, though the reference somewhat change.
I'm testing this in Unity 4.3.3 with the two simple scenes each consisting of an UIRoot, camera, and a sprite with different atlas source.

6
Hmm.. Nope, the unused atlas texture is still referenced.
I tried attaching this script to an empty GameObject in each scene.

  1. using UnityEngine;
  2. using System.Collections;
  3. using System.Collections.Generic;
  4.  
  5. public class TestChangeScene : MonoBehaviour {
  6.         public string targetScene;
  7.        
  8.         void Start ()
  9.         {
  10.                 Resources.UnloadUnusedAssets();
  11.         }
  12.  
  13.         void Update()
  14.         {
  15.                 if(Input.GetKeyDown(KeyCode.Space))
  16.                 {
  17.                         TriggerSceneChange();
  18.                 }
  19.         }
  20.  
  21.         public void TriggerSceneChange()
  22.         {
  23.                 UIWidget[] widgets = Resources.FindObjectsOfTypeAll<UIWidget>();
  24.                 foreach(UIWidget tmp in widgets)
  25.                 {
  26.                         Debug.Log("destroying : " + tmp.name);
  27.                         Destroy(tmp);
  28.                 }
  29.                 StartCoroutine(unload());
  30.         }
  31.  
  32.         IEnumerator unload()
  33.         {
  34.                 yield return new WaitForEndOfFrame();
  35.                 Resources.UnloadUnusedAssets();
  36.                 Application.LoadLevel(targetScene);
  37.         }
  38. }

When sampling the profiler inside the second scene, the texture from atlas of the first scene is still referenced.

7
NGUI 3 Support / Unused Atlas Not Cleaned Up Properly When Changing Scene
« on: January 30, 2014, 03:18:18 AM »
Hello,

Sorry if my question had been asked before. I've run into some memory problem I've noticed when developing for some older iOS device.
My game has several atlases, one main UI atlas, and some scene specific atlases for different scenes. The NGUI version I'm using is 3.0.9f2
When I do some profiling in Unity & XCode I've noticed when changing into scenes which uses different atlas, the memory usage keeps increasing,
until eventually the app crashed on weaker old devices.

When I run a profiler in Unity I've noticed that the unused atlas still has references even though no objects are currently using that atlas in the current scene.
Specifically it says ManagedStaticReferences in the profiler (didn't really understand what that mean).

My atlas usage flow is something like this :
Atlas -> atlas assigned to Reference Atlas Prefab -> prefab assigned to various UISprites in Scene (reference atlas prefab is there to make it easier for changing between SD / HD Atlas source)

I've also tried to create a clean project to test this case with a simpler flow where atlas are assigned directly to UISprites, and it is still not cleaned when changing scenes.

I've tried using Resources.UnloadUnusedAsset() and System.GC.Collect(), but it seemed to have no effects, most likely because there's still some references to the atlas.
Is this a problem with NGUI / Unity, or am I doing something wrong with how I design my usage flow?

Pages: [1]