Ejemplo n.º 1
0
        public void DestroyDrawChild()
        {
            int childCount = rectTransform.childCount;

            var components = ListPool <Component> .Get();

            Draw d;

            for (int i = 0; i < childCount; ++i)
            {
                if ((d = (rectTransform.GetChild(i)).GetComponent <Draw>()) != null)
                {
                    components.Add(d as Component);
                }
            }

            for (int i = 0; i < components.Count; ++i)
            {
                Tools.Destroy(components[i].gameObject);
            }

            ListPool <Component> .Release(components);
        }
Ejemplo n.º 2
0
 public void DestroySelf()
 {
     Tools.Destroy(gameObject);
 }