Destroy every children of a transform, using delay or not.
using BaseTool;
using UnityEngine;
Transform scrollView; // let's admit it's initialized
scrollView.Clear();
foreach(int i in 0..5)
Instantiate(prefab, scrollView);
ClearImmediate()
Destroy every children of a transform, using the Object.DestroyImmediate() method.
using BaseTool;
using UnityEngine;
Transform scrollView; // let's admit it's initialized
scrollView.ClearImmediate();
foreach(int i in 0..5)
Instantiate(prefab, scrollView);
Transform Extensions
Clear()
andClear(float time)
Destroy every children of a transform, using delay or not.
ClearImmediate()
Destroy every children of a transform, using the
Object.DestroyImmediate()
method.