public virtual MonoBehaviour Add <T>(string label, bool addSameLevel, bool addBefore = false, bool makeSelection = false, int startIndex = 1) where T : TC_ItemBehaviour
        {
            GameObject newItemGo = new GameObject();
            Transform  newItemT  = newItemGo.transform;

            Type type = typeof(T);

            if (label == "")
            {
                if (type == typeof(TC_LayerGroup))
                {
                    label = "Layer Group";
                }
                else if (type == typeof(TC_Layer))
                {
                    label = "Layer";
                }
                else if (type == typeof(TC_Node))
                {
                    label = "Node";
                }
                else if (type == typeof(TC_SelectItem))
                {
                    label = "Item";
                }
                else if (type == typeof(TC_SelectItemGroup))
                {
                    label = "ItemGroup";
                }
            }

            // Debug.Log("Add " + label);
            newItemT.name = label;

            #if UNITY_EDITOR
            if (makeSelection)
            {
                UnityEditor.Selection.activeTransform = newItemT;
            }
            #endif

            int index;
            TC_ItemBehaviour item = newItemGo.AddComponent <T>();
            // Version number
            item.SetVersionNumber();

            item.outputId = outputId;

            if (addSameLevel)
            {
                newItemT.parent = t.parent;
                index           = t.GetSiblingIndex() + (addBefore ? 1 : 0);
                newItemT.SetSiblingIndex(index);
            }
            else
            {
                if (type == typeof(TC_SelectItemGroup))
                {
                    startIndex = 2;
                }

                newItemT.parent = t;
                newItemT.SetSiblingIndex(index = startIndex);
            }

            if (newItemT.parent != null)
            {
                newItemT.localPosition = Vector3.zero;
            }

            if (type == typeof(TC_Node))
            {
                ((TC_Node)item).SetDefaultSettings();
            }

            else if (type == typeof(TC_LayerGroup))
            {
                if (outputId != TC.heightOutput && outputId != TC.grassOutput)
                {
                    item.method = Method.Lerp;
                }
                item.Add <TC_NodeGroup>("Mask Group", false);
                item.Add <TC_LayerGroupResult>("Result", false);
            }
            else if (type == typeof(TC_Layer))
            {
                if (outputId != TC.heightOutput && outputId != TC.grassOutput)
                {
                    item.method = Method.Lerp;
                }
                AddLayerNodeGroups((TC_Layer)item);
            }

            return(item);
        }