You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
27 lines
569 B
27 lines
569 B
4 years ago
|
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);
|
||
|
}
|
||
|
}
|
||
|
}
|