public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        MapSegmentBuilder mapSegment = (MapSegmentBuilder)target;

        Undo.RecordObject(mapSegment, "change points");

        if (GUILayout.Button("Add Point"))
        {
            mapSegment.AddPoint();
        }

        if (GUILayout.Button("Remove Point"))
        {
            mapSegment.RemovePoint();
        }

        if (GUILayout.Button("Reverse Points"))
        {
            mapSegment.ReversePoints();
        }

        if (GUILayout.Button("Reset Points"))
        {
            mapSegment.ResetPoints();
        }

        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);

        if (GUILayout.Button("Double Waypoints"))
        {
            mapSegment.DoublePoints();
        }
    }
Exemple #2
0
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        MapSegmentBuilder mapSegment = (MapSegmentBuilder)target;

        Undo.RecordObject(mapSegment, "change points");

        if (GUILayout.Button("Add Point"))
        {
            mapSegment.AddPoint();
        }

        if (GUILayout.Button("Remove Point"))
        {
            mapSegment.RemovePoint();
        }

        if (GUILayout.Button("Reverse Points"))
        {
            mapSegment.ReversePoints();
        }

        if (GUILayout.Button("Reset Points"))
        {
            mapSegment.ResetPoints();
        }
    }
    public override void OnInspectorGUI()
    {
        DrawDefaultInspector();
        MapSegmentBuilder mapSegment = (MapSegmentBuilder)target;

        Undo.RecordObject(mapSegment, "change points");

        if (GUILayout.Button("Add Point at end index"))
        {
            mapSegment.AddPoint();
        }

        if (GUILayout.Button("Add Point at zero index"))
        {
            mapSegment.InsertPointAtZeroIndex();
        }

        if (GUILayout.Button("Remove Point"))
        {
            mapSegment.RemovePoint();
        }

        if (GUILayout.Button("Reverse Points"))
        {
            mapSegment.ReversePoints();
        }

        if (GUILayout.Button("Reset Points"))
        {
            mapSegment.ResetPoints();
        }

        EditorGUILayout.LabelField("", GUI.skin.horizontalSlider);

        if (GUILayout.Button("Double Subsegments"))
        {
            if (!mapSegment.DoubleSubsegments())
            {
                Debug.Log($"{nameof(mapSegment.DoubleSubsegments)} fail");
            }
        }

        if (GUILayout.Button("Half Subsegments"))
        {
            if (!mapSegment.HalfSubsegments())
            {
                Debug.Log($"{nameof(mapSegment.HalfSubsegments)} fail");
            }
        }
    }