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

Pages: [1]
1
NGUI 3 Support / NGUITools.AddChild !!
« on: June 08, 2017, 05:28:12 AM »
NGUI 3.11.4

< NGUITools.cs >

   static public GameObject AddChild (this GameObject parent, GameObject prefab, int layer)
   {
      var go = GameObject.Instantiate(prefab) as GameObject;
#if UNITY_EDITOR
      if (!Application.isPlaying)
         UnityEditor.Undo.RegisterCreatedObjectUndo(go, "Create Object");
#endif
      if (go != null)
      {
         go.name = prefab.name;

         if (parent != null)
         {
            Transform t = go.transform;
            t.parent = parent.transform;
            t.localPosition = Vector3.zero;
            t.localRotation = Quaternion.identity;
            t.localScale = Vector3.one;
            if (layer == -1) go.layer = parent.layer;
            else if (layer > -1 && layer < 32) go.layer = layer;
         }
         go.SetActive(true);  <---------- What the hell !!!  >:( >:( >:(
      }
      return go;
   }


It was never before!
Someone can bug hard!

2
NGUI 3 Support / Re: can't set mainTexture of UITexture to null
« on: February 08, 2017, 03:10:26 AM »
I also need to set mainTexture to null.
I am using the modified code now, but I hope NGUI will fix it.

3
NGUI 3 Support / Re: Broken Dynamic Font
« on: September 17, 2015, 12:16:01 AM »
mActiveTTF is not safe in textureRebuildCallback. (UILabel.cs line 951 : UILabel.SetActiveFont() )
So I am using the following:
  1. Font font = mActiveTTF;
  2. if (!mFontUsage.TryGetValue(mActiveTTF, out usage))
  3.     mActiveTTF.textureRebuildCallback = delegate() { OnFontChanged(font); };
  4.  

UNITY 4.6.8p1
NGUI 3.9.2

Pages: [1]