Example #1
0
    public override void OnInspectorGUI()
    {
        l = (LineGenerator)target;
        //EditorGUILayout.PropertyField(linesProperty);
        if (l.line == null)
        {
            l.CreateLine();
        }
        //editorLine = l.line;
        DrawDefaultInspector();

        /*if(GUILayout.Button("Add new line with new node"))
         * {
         *  Undo.RecordObject(l, "Add line");
         *  l.AddLine(l.activeNodeIndex, l.newNodePosition);
         * }*/
        if (GUILayout.Button("Add new line with existing node"))
        {
            Undo.RecordObject(l, "Connect line");
            l.ConnectLine(l.activeNodeIndex, l.toIndex);
        }
        if (GUILayout.Button("Initialize points and line"))
        {
            Undo.RecordObject(l, "Initialize lines");
            l.InitializeLine();
        }
    }