Example #1
0
    private void DrawEditorButtons()
    {
        //figure out width and height
        Vector2 size = new Vector2(1f * position.size.x, .15f * position.size.y);

        //figure out offset
        Vector2 offset = position.size;

        offset.Scale(new Vector2(0f, .95f));
        // offset -= size * .5f;

        //GUILayout.BeginArea(new Rect(offset,size));
        EditorGUILayout.BeginHorizontal();
        EditorGUILayout.LabelField("Graph Name: ", EditorStyles.boldLabel, GUILayout.ExpandWidth(false));
        graph.GraphName = EditorGUILayout.TextField(graph.GraphName, GUILayout.ExpandWidth(false));
        EditorGUILayout.EndHorizontal();
        EditorGUILayout.BeginHorizontal();

        if (GUILayout.Button("Validate", GUILayout.ExpandWidth(false)))
        {
            ValidateGraph();
        }

        if (GUILayout.Button("Dummy Evaluate (x:0,y:0,z:0)", GUILayout.ExpandWidth(false)))
        {
            Log(graph.Evaluate(new SamplePointVariables(0, 0), new SamplePointVariables(0, 0), new SamplePointVariables(0, 0)).ToString());
        }

        EditorGUILayout.EndHorizontal();
        DrawSaveAndLoadButtons();
        // GUILayout.EndArea();
    }