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); } } }
public void showFrame() { if (string.IsNullOrEmpty(frameName)) { return; } CLUIOtherObjPool.borrowObjAsyn(frameName, (Callback)onBorrowFrame); }
public void releaseFrame() { if (frameObj != null) { CLUIOtherObjPool.returnObj(frameObj.gameObject); NGUITools.SetActive(frameObj.gameObject, false); frameObj = null; } }