コード例 #1
0
        public UBulletObject RemoveChild(UBulletObject obj, bool shouldReturnToPool = true)
        {
            this.children.Remove(obj);              // SLOW, but should be okay...
            obj.SetParent(null);
            if (shouldReturnToPool)
            {
                // Setting its parent transform back to the pool itself
                obj.GetTransform().SetParent(obj.GetPoolManager().GetPoolTransform());
            }

            return(this);
        }
コード例 #2
0
        public UBulletObject AddChild(UBulletObject obj)
        {
            if (this.children == null)
            {
                this.children = new List <UBulletObject> ();
            }
            this.children.Add(obj);
            obj.SetParent(this);
            obj.GetTransform().SetParent(this.childTrans);

            return(this);
        }