using AX.MessageSystem; using System; using System.Collections; using System.Collections.Generic; using UnityEngine; public class nullLineObj : MonoBehaviour { // Use this for initialization void Start () { MessageDispatcher.AddListener("ClearObject", Clear); } private void OnDestroy() { MessageDispatcher.RemoveListener("ClearObject", Clear); } private void Clear(IMessage obj) { for (int i = 0; i < transform.childCount; i++) { Destroy(transform.GetChild(i).gameObject); } } }