Ejemplo n.º 1
0
        void onBorrowFrame(params object[] objs)
        {
            GameObject frame = objs[1] as GameObject;

            if (frame != null)
            {
                if (frameObj != null)
                {
                    CLUIOtherObjPool.returnObj(frame);
                    NGUITools.SetActive(frame, false);
                    return;
                }
                frameObj = frame.GetComponent <CLCellLua>();
                if (frameObj == null)
                {
                    frameObj = frame.AddComponent <CLCellLua>();
                }
                frameObj.transform.parent           = transform;
                frameObj.transform.localScale       = Vector3.one;
                frameObj.transform.localPosition    = Vector3.zero;
                frameObj.transform.localEulerAngles = Vector3.zero;
                NGUITools.SetActive(frameObj.gameObject, true);
                if (frameObj.luaTable == null)
                {
                    frameObj.setLua();
                }

                if (lfonShowFrame != null)
                {
                    call(lfonShowFrame, this);
                }
            }
        }
Ejemplo n.º 2
0
 public void showFrame()
 {
     if (string.IsNullOrEmpty(frameName))
     {
         return;
     }
     CLUIOtherObjPool.borrowObjAsyn(frameName, (Callback)onBorrowFrame);
 }
Ejemplo n.º 3
0
 public void releaseFrame()
 {
     if (frameObj != null)
     {
         CLUIOtherObjPool.returnObj(frameObj.gameObject);
         NGUITools.SetActive(frameObj.gameObject, false);
         frameObj = null;
     }
 }