예제 #1
0
파일: DeleteChilds.cs 프로젝트: dorog/onlab
    void Update()
    {
        if (transform.childCount > 0)
        {
            Transform child = transform.GetChild(0);

            CommandData cmdData = child.GetComponent <CommandData>();
            if (cmdData == null)
            {
                Debug.LogError("DeleteChilds: No commandData on the child!");
                return;
            }
            int slotNumber = cmdData.Command.PanelSlot;

            commandPanel.DeleteCommandBySlot(slotNumber);

            Destroy(child.gameObject);
        }
    }