예제 #1
0
 // 设置父类,属于UGUI特有的
 public override void SetParent(Transform trans)
 {
     if (_poolDefaultRect == null)
     {
         _poolDefaultRect = gameObject.GetComponent <RectTransform>();
     }
     RectTransformHelper.SetParent(_poolDefaultRect, trans);
 }
예제 #2
0
        private void Init()
        {
            // 1.创建RectTransform
            _factoryGoRootRect = GameObjectHelper.CreateRectTransform(_factoryName);
            _factoryGoRoot = _factoryGoRootRect.gameObject;

            // 2.挂载在 UGUI对象池下面的Root GameObject下面的东西
            RectTransformHelper.SetParent(_factoryGoRootRect, RectTransformPool.Instance.FindTrans());
        }