GPUGraph.SubGraphNode.CustomGUI C# (CSharp) Method

CustomGUI() protected method

protected CustomGUI ( ) : bool
return bool
        protected override bool CustomGUI()
        {
            bool changed = false;

            {
                bool oldConverted = convertParamsToInputs;
                convertParamsToInputs = GUILayout.Toggle(convertParamsToInputs, "Convert params to inputs");
                if (oldConverted && !convertParamsToInputs)
                {
                    changed = true;
                    Inputs.Clear();
                    InputNames.Clear();
                    InputDefaultVals.Clear();
                }
                else if (!oldConverted && convertParamsToInputs)
                {
                    changed = true;
                    Graph g = TryLoadGraph();
                    if (g == null)
                    {
                        convertParamsToInputs = false;
                    }
                    else
                    {
                        SetInputsFrom(new GraphParamCollection(g).FloatParams);
                    }
                }
            }

            Vector2 textDims = GUI.skin.label.CalcSize(new GUIContent("Graph:"));
            EditorGUIUtility.labelWidth = textDims.x;
            int newIndex = EditorGUILayout.Popup("Graph:", selected, names, GUILayout.MinWidth(100.0f));

            if (selected != newIndex)
            {
                selected = newIndex;
                ChangeGraph();
                changed = true;
            }

            if (GUILayout.Button("Refresh graphs"))
            {
                changed = CheckOutGraphs(true) || changed;
            }

            return changed;
        }