//set //------------------------------------------------------------------------------------------------------------------------------------- public void setParent(txUIObject parent) { if (mParent == parent) { return; } // 从原来的父节点上移除 mParent?.removeChild(this); // 设置新的父节点 mParent = parent; if (parent != null) { parent.addChild(this); if (mTransform.parent != parent.getTransform()) { mTransform.SetParent(parent.getTransform()); } } }