示例#1
0
 /// <summary>
 ///     Destroys all the children of a transform.
 /// </summary>
 /// <param name="transform">The transform containing the children to destroy.</param>
 public static void DestroyAllChildren(this Transform transform)
 {
     if (!transform)
     {
         return;
     }
     for (int i = transform.childCount - 1; i >= 0; i--)
     {
         Transform t = transform.GetChild(i);
         if (!t)
         {
             continue;
         }
         UnityUtils.DestroyObject(t);
     }
 }
示例#2
0
 // Start is called before the first frame update
 private void Start()
 {
     UnityUtils.DestroyObject(this, m_Time);
 }
示例#3
0
 private void Awake()
 {
     UnityUtils.DestroyObject(this);
 }