コード例 #1
0
    public void DeleteObject(GameObject item)
    {
        ObjectScript script = (ObjectScript)item.GetComponent("ObjectScript");

        Debug.Log(item.name);
        script.delete();
    }
コード例 #2
0
 public void delete()
 {
     foreach (GameObject child in children)
     {
         ObjectScript script = (ObjectScript)child.GetComponent("ObjectScript");
         script.delete();
     }
     gameObject.active = false;
 }