Exposing a function to the inspector

I wish to expose a script’s function to the inspector, but I have no clue how to.
I found [this][1] here, which was a start, but it isn’t clear how to finish.

My code for the class:

[System.Serializable]
    class MoveAction : UnityEvent<MonoBehaviour>, IUIAnimationEvent
    {
        #region Move
        public MoveAction()
        {

        }
        //to ensure only one mover coroutine can be active.
        IEnumerator moveRoutine = null;
        #region Solution 2: using fields and not parameters
        Transform from;
        Transform to;
        float overTime;
        public delegate void UIchain(MonoBehaviour mono);
        public event UIchain NEXT_FUNCTION;
        
        public MoveAction(Transform from, Transform to, float overTime, IUIAnimationEvent chain)
        {
            this.from = from;
            this.to = to;
            this.overTime = overTime;

        }
        public void Move(MonoBehaviour mono)
        {
            if (moveRoutine != null)
            {
                mono.StopCoroutine(moveRoutine);
            }
            moveRoutine = _Move(from, to, overTime, mono);
            mono.StartCoroutine(moveRoutine);
            Invoke(mono);
        }
        IEnumerator _Move(Transform from, Transform to, float overTime, MonoBehaviour mono)
        {
            Vector2 original = from.position;
            float timer = 0.0f;
            while (timer < overTime)
            {
                float step = Vector2.Distance(original, to.position) * (Time.deltaTime / overTime);
                from.position = Vector2.MoveTowards(from.position, to.position, step);
                timer += Time.deltaTime;
                yield return null;
            }
            if(NEXT_FUNCTION != null)
            {
                NEXT_FUNCTION(mono);
            }
        }

This is a lot of code, but the interesting part is the Move(MonoBehaviour mono) function.
I want to expose that to the editor. How?
[1]: Select monobehaviour function from inspector - Questions & Answers - Unity Discussions

you cannot expose a function (it’s called method in C#). you can however expose a unity event (like in your posted question). all you need is

[System.Serializable]
     public class MoveAction : UnityEvent<MonoBehaviour>{}

and in a different class

public MoveAction moveAction;

I found the answer I was looking for here: c# - Unity - Exposing a function to the inspector - Game Development Stack Exchange

what you are looking for is the Unity
Event class. See this example below.
This will appear in the editor exactly
like your screenshot.

using UnityEngine;
using UnityEngine.Events;
using System.Collections;

public class InvokeOnAwake : MonoBehaviour {

    public UnityEvent invokeMethod;//set in editor

    void Awake(){
        invokeMethod.Invoke();
    }

}

If what you want is a button that you can click in the inspector to do some editor work, you need to make a custom inspector.

[CustomEditor(typeof(YourClassName))]
[CanEditMultipleObjects] // only if you handle it properly
public class YourClassNameEditor : UnityEditor.Editor
{
    public override void OnInspectorGUI()
    {
        if (GUILayout.Button("DO THAT", EditorStyles.miniButton))
        {
            (YourClassName)this.target).YourMethod (parameters);
        }
        DrawDefaultInspector ();
    }
}

You will also need to handle Undo then.