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

Pages: [1]
1
NGUI 3 Support / Re: vertical scrollview with 1000+ row item
« on: January 07, 2014, 05:16:21 AM »
Thx a lot. Nicki, ArenMook!
I tried Plan A, it work perfectly!

That's nice, can you share the code a bit, I'm working on it too   :)

2
NGUI 3 Documentation / Re: UIRoot
« on: December 18, 2013, 02:33:06 AM »
I suggest to have a scale factor which is used to scale up the gameobject that UIRoot is attached to and to set NGUI camera's size property. For example I am using NGUI anchoring with rage tool, I choose the screen height to be 640, scaling style is FixedSize, and the whole NGUI system is too small compared to unity unit. The transform's scale of UIRoot attached-gameobject is set to 0.002472188 which is very small and Rage tool is messed up with that tiny scale. Thus I modified the code a little bit:

in UIRoot.cs:

public float scale = 1000;

protected virtual void Start ()
   {
      UIOrthoCamera oc = GetComponentInChildren<UIOrthoCamera>();

      if (oc != null)
      {
         Debug.LogWarning("UIRoot should not be active at the same time as UIOrthoCamera. Disabling UIOrthoCamera.", oc);
         Camera cam = oc.gameObject.GetComponent<Camera>();
         oc.enabled = false;
         if (cam != null) cam.orthographicSize = 1f * scale;
      }
      else Update();
   }

void Update ()
   {
#if UNITY_EDITOR
      if (!Application.isPlaying && gameObject.layer != 0)
         UnityEditor.EditorPrefs.SetInt("NGUI Layer", gameObject.layer);
#endif
      if (mTrans != null)
      {
         float calcActiveHeight = activeHeight;

         if (calcActiveHeight > 0f )
         {
            float size = 2f / calcActiveHeight;
            
            Vector3 ls = mTrans.localScale;
   
            if (!(Mathf.Abs(ls.x - size) <= float.Epsilon) ||
               !(Mathf.Abs(ls.y - size) <= float.Epsilon) ||
               !(Mathf.Abs(ls.z - size) <= float.Epsilon))
            {
               mTrans.localScale = new Vector3(size * scale, size * scale, size * scale);
            }
         }
      }
   }

I am not sure if it break the other code as now It work just fine to me. Hope to have this scale factor variable in the next version.

3
NGUI 3 Support / Re: NGUI 3.0
« on: September 24, 2013, 08:34:17 AM »
@emperor1412: The issue has been fixed with 3.0.0c (released).

That's great, what a good new, everything in my game is about sprite animation. Before 3.0.0, there were an issue like if 1 sprite in a panel is moveing then the whole geometry of the panel is rebuild, like that there is a huge performance lost every frame. Now although I'm not so sure how you batched sprite together and manage their geometry, but the problem seem to be solved. Can you talk a little bit about it.

One more thing is before I separate sprites by panel, manage the depth within a panel, each panel has different transform.position.z, but now as I see in previous post, it won't work anymore, the depth has to me manually managed over. All the widgets will be created at runtime and it turned out that all of them have the same depth which cause incorrect rendering.
I tried NormalizeDepths() at run time but it doesn't help to adjust the depth of widgets correctly. Is there a way to deal with it?

4
The first will get a huge amount of UIPanel.LateUpdate time spent rebuilding the underlying geometry used to draw with.

This one is no longer true in NGUI 3.0.0, the underlying geometry is not rebuild if 1 widget is moving around, that helps a lot in term of performance.

5
NGUI 3 Support / Re: NGUI 3.0
« on: September 22, 2013, 05:38:11 AM »
How so? Details are key.

Hi ArenMook, the attachment contain the spritesheet atlases that I used to make spriteanimation. You'll see that one contains same size sprites worsk correctly, the other contains differents size sprites works incorrectly but it works correctly in NGUI before 3.0.0

6
NGUI 3 Support / Re: NGUI 3.0
« on: September 21, 2013, 01:22:22 PM »
Hi ArenMook, SpriteAnimation now works incorrectly in NGUI 3.0, there is something wrong with the position, can you check it please.

Pages: [1]