SetParent() public static method

public static SetParent ( Transform t, Transform parent ) : void
t UnityEngine.Transform
parent UnityEngine.Transform
return void
Example #1
0
        virtual public void FreeObject(IHtmlObject obj)
        {
            obj.Release();
            if (!Application.isPlaying)
            {
                obj.Dispose();
                return;
            }

            //可能已经被GameObject tree deleted了,不再回收
            if (obj.displayObject != null && obj.displayObject.isDisposed)
            {
                return;
            }

            if (obj is HtmlImage)
            {
                _imagePool.Push(obj);
            }
            else if (obj is HtmlInput)
            {
                _inputPool.Push(obj);
            }
            else if (obj is HtmlButton)
            {
                _buttonPool.Push(obj);
            }
            else if (obj is HtmlLink)
            {
                _linkPool.Push(obj);
            }

            if (obj.displayObject != null)
            {
                if (_poolManager == null)
                {
                    _poolManager = Stage.inst.CreatePoolManager("HtmlObjectPool");
                }

                ToolSet.SetParent(obj.displayObject.cachedTransform, _poolManager);
            }
        }