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 - Leopotam

Pages: [1]
1
NGUI 3 Support / Re: [FIX] UIDrawCall GC allocation removing
« on: April 06, 2016, 03:47:01 PM »
Quote
you will effectively make NGUI mark the scene as edited continuously.
Checked right now - scene not marked as modified on each call of "mRenderer.sortingLayerName = value;", it means - they compare values internally and mark scene as dirty only on change.

Quote
Getter is currently not used by NGUI at all.
Why not fixed finally possible GC allocation even on getter? Its public api method and can be used by anyone with GC side effect.

2
NGUI 3 Support / Re: [FIX] UIDrawCall GC allocation removing
« on: April 06, 2016, 03:37:14 PM »
Well, why you think that engine dont compare new value with current one internally? About "better approach" - GC allocation on each getter call, better to return cached mSortingLayerName and fill it at OnEnable or something like this.
Ah, understood about "mark the scene as edited continuously." - this can be fixed with "#if UNITY_EDITOR" wrapping.

3
NGUI 3 Support / [FIX] UIDrawCall GC allocation removing
« on: April 05, 2016, 07:03:59 PM »
Issue: each time of calling "renderer.sortingLayerName" getter GC memory will be allocated. Checked with unity 5.3.4f1.
Fix:
UIDrawCall, 137 loc:
replace
  1. set { if (mRenderer != null && mRenderer.sortingLayerName != value) mRenderer.sortingLayerName = value; }
with
  1. set { if (mRenderer != null) mRenderer.sortingLayerName = value; }

4
Use POT (power of two) textures with size 2-4-8-16-32-64-128-256-512-1024-2048-4096-8192 on side + enable mipmaps.

5
NGUI 3 Support / Re: Screenshots to UISprite
« on: July 01, 2015, 05:59:22 AM »
You cant, use UITexture instead.

6
NGUI 3 Support / Re: FreeType64.dylib for Font Maker in Unity 5 Mac?
« on: July 01, 2015, 04:57:59 AM »
Edit: Leopotam here on the forums shared a fix for some of the disappearing text in-editor, which was very helpful and one of my greater concerns. Is that missing/jumbled text issue prevalent in actual builds on devices as well?
It was only for editor font glitches, in runtime / on devices its already should work without issues.

7
NGUI 3 Support / [FIX] Ngui dynamic fonts disappearing on scene save.
« on: June 22, 2015, 01:32:41 AM »
I waited 2 months for official fix, but it not happend. So, there is dirty fix for dynamic fonts issue:
*) non-intrusive - no changes to official ngui code.
*) auto apply on scene save, no need to tire user for pressing some menu items, just press "save scene" (ctrl+s / cmd+s) if font issue happens.
How to use - just import attached package, thats all.

UPD: For non-authorized users (who cant get access to attachment):
  1. using UnityEngine;
  2. using UnityEditor;
  3.  
  4. namespace LeopotamGroup.UnityEditor.NguiExtensions {
  5.     sealed class NguiFixer : global::UnityEditor.AssetModificationProcessor {
  6.         static string[] OnWillSaveAssets (string[] paths) {
  7.             foreach (var path in paths) {
  8.                 if (path == EditorApplication.currentScene) {
  9.                     FixLabels ();
  10.                 }
  11.             }
  12.  
  13.             return paths;
  14.         }
  15.  
  16.         static void FixLabels () {
  17.             foreach (var item in Object.FindObjectsOfType<UILabel> ()) {
  18.                 item.MarkAsChanged ();
  19.             }
  20.         }
  21.     }
  22. }

Pages: [1]