How to add ur own function/script to event trigger in canvas?

I have a Jump button in canvas that I wanna reference to my own script when someone touches it (mobile). I added my own script to the button object and an event trigger component. When I tried to select my script in the event trigger component I couldn’t see my own function… (Canvas-> JumpButton->event trigger-> add new event type-> pointer click->button->?). Do I have to use a function from Unity or can I use my own? Thanks in advance!

private Button ClearPurchasingDataButton;
private string ClearPurchasingDataButtonTag = “ClearPurchasingDataButton”;
void Awake()
ClearPurchasingDataButton = GameObject.FindGameObjectWithTag(ClearPurchasingDataButtonTag).GetComponent();

        ClearPurchasingDataButton.onClick.AddListener(OnClearUnityPurchasingPath);

        }
        [MenuItem("Editors/ZeredaGamesEngine/Game Making Tools/Delete/Clear Unity Purchasing Path", false, 1)]
        public static void OnClearUnityPurchasingPath()
        {
                if (EditorUtility.DisplayDialog("Clear Unity Purchasing Entries", "Are you sure you want to clear Unity Purchasing data for this project? ", "Clear", "Skip"))
    {
              string unityPurchasingPath = System.IO.Path.Combine(System.IO.Path.Combine(Application.persistentDataPath, "Unity"), "UnityPurchasing");
        if (System.IO.Directory.Exists(unityPurchasingPath))
        {
            System.IO.Directory.Delete(unityPurchasingPath, true);
        }
        if (Instance.DebugMode)
        {
            string message = System.DateTime.Now.ToString();
            Debug.Log("[" + message + "] [UNITY PURCHASING PATH CLEARED]");
        }
    }
}

Link to more data

Your function that is going to be called by event trigger should be:

  1. public
  2. have a void return type
  3. take one or no parameter.