// 设置父类,属于UGUI特有的 public override void SetParent(Transform trans) { if (_poolDefaultRect == null) { _poolDefaultRect = gameObject.GetComponent <RectTransform>(); } RectTransformHelper.SetParent(_poolDefaultRect, trans); }
private void Init() { // 1.创建RectTransform _factoryGoRootRect = GameObjectHelper.CreateRectTransform(_factoryName); _factoryGoRoot = _factoryGoRootRect.gameObject; // 2.挂载在 UGUI对象池下面的Root GameObject下面的东西 RectTransformHelper.SetParent(_factoryGoRootRect, RectTransformPool.Instance.FindTrans()); }