protected virtual void DrawNodeWindow(int id)
        {
            if ((this is SWNodeRoot) || !titleEditing)
            {
                GUI.Label(rectTop, data.name, SWEditorUI.Style_Get(SWCustomStyle.eNodeTitle));
                if (Event.current.type == EventType.mouseUp &&
                    rectTop.Contains(Event.current.mousePosition))
                {
                    titleEditing = true;
                    nameEditing  = data.name;
                }
            }
            else
            {
                if (Event.current.type == EventType.KeyUp && Event.current.keyCode == KeyCode.Return)
                {
                    titleEditing = false;

                    nameEditing = SWCommon.NameLegal(nameEditing);
                    if (NameUnique(nameEditing))
                    {
                        data.name = SWCommon.NameLegal(nameEditing);
                    }
                }
                nameEditing = EditorGUI.TextField(rectTop, nameEditing, SWEditorUI.Style_Get(SWCustomStyle.eNodeTitle));
            }
            GUILayout.Space(headerHeight);
        }
        public virtual string TextureShaderName()
        {
            if (this is SWNodeRoot || (SWWindowMain.Instance.nRoot.texture != null && texture == SWWindowMain.Instance.nRoot.texture))
            {
                return("MainTex");
            }

            string name = textureDuplicatedSuffix == 0 ? SWCommon.NameLegal(Texture.name) : SWCommon.NameLegal(Texture.name) + "_" + textureDuplicatedSuffix;

            return(name);
        }
        protected void Factor_CustomParamCreation()
        {
            paramNameLastDeleted = "";
            DrawModuleTitle("Custom Parameters");
            Rect lastRect = GUILayoutUtility.GetLastRect();
            Rect rect     = new Rect(lastRect.x, lastRect.y, lastRect.width + SWGlobalSettings.FieldWidth, lastRect.height + rightUpUnitHeight);

            Tooltip_Rec(SWTipsText.Right_CustomParam, rect);

            paramName = EditorGUILayout.TextField(paramName, GUILayout.Width(100));


            GUILayout.BeginHorizontal();
            if (GUILayout.Button("New Float", GUILayout.Width(80)))
            {
                paramName = SWCommon.NameLegal(paramName);
                if (NameUnique(paramName))
                {
                    SWParam pa = new SWParam();
                    pa.type = SWParamType.FLOAT;
                    pa.name = paramName;
                    SWWindowMain.Instance.data.paramList.Add(pa);
                }
                paramName = "";
            }
            if (GUILayout.Button("New Range", GUILayout.Width(80)))
            {
                paramName = SWCommon.NameLegal(paramName);
                if (NameUnique(paramName))
                {
                    SWParam pa = new SWParam();
                    pa.type = SWParamType.RANGE;
                    pa.name = paramName;
                    SWWindowMain.Instance.data.paramList.Add(pa);
                }
                paramName = "";
            }
            GUILayout.EndHorizontal();


            int toDeleteId = -1;

            for (int i = 0; i < SWWindowMain.Instance.data.paramList.Count; i++)
            {
                //GUILayout.Space (SWGlobalSettings.UIGap);
                var item = SWWindowMain.Instance.data.paramList[i];
                GUILayout.BeginHorizontal();
                float nameWidth = 64f;
                GUILayout.Label(item.name, SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(nameWidth));
                if (item.type == SWParamType.RANGE)
                {
                    GUILayout.Label("Min", SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(22));
                    item.min = EditorGUILayout.FloatField("", item.min, GUILayout.Width(25));
                    GUILayout.Label("Max", SWEditorUI.Style_Get(SWCustomStyle.eTxtSmallLight), GUILayout.Width(26));
                    item.max = EditorGUILayout.FloatField("", item.max, GUILayout.Width(25));
                }
                if (item.type == SWParamType.FLOAT)
                {
                    item.defaultValue = EditorGUILayout.FloatField(item.defaultValue, GUILayout.Width(rightupWidth - nameWidth - SWGlobalSettings.UIGap * 2 - 18 - 2));
                }

                lastRect = GUILayoutUtility.GetLastRect();

                if (GUI.Button(new Rect(position.width - 30 - SWGlobalSettings.UIGap, lastRect.y, 18, 17), "X"))
                {
                    toDeleteId = i;
                }
                GUILayout.EndHorizontal();
            }
            if (toDeleteId >= 0)
            {
                paramNameLastDeleted = SWWindowMain.Instance.data.paramList[toDeleteId].name;
                SWWindowMain.Instance.data.paramList.RemoveAt(toDeleteId);
            }
        }