コード例 #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);
        }
    }