How to select Object's voids through Inspector tab?

Issue:

I’m having some trouble. I want to be able to select any public void on the Objects I set up in the Inspector, but it’s a really tricky thing to figure out, because Unity don’t give any tips on how to do it. I imagine something like the Button.OnClick(). I set an Object, and then select a method.

I don’t have any piece of code to show.


Conclusion:

As I’m not being able to figure it out, and don’t know how to search it on Google, I’m asking here.

So, thanks in advance.

There are lots of ways to do it!

If you want to do it like Button component, Look for UnityEvents.
Example:

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

public class CertainClass: MonoBehaviour
{
    public UnityEvent theEvent;
    
    public void CertainVoid()
    {
        theEvent.Invoke();
    }
}

You could also create an Enum with all the voids stored in it like this:

    public enum AllVoids
    {
        None,
        Void1,
        Void2,
        Void3
    }
    
    public AllVoids selectedVoid = AllVoids.None;

    public void CertainVoid()
    {
        switch(selectedVoid)
        {
        case AllVoids.Void1:
            Void1();
            break;

        case AllVoids.Void2:
            Void2();
            break;

        case AllVoids.Void3:
            Void3();
            break;

        default:
            debug.Log("Please Define a Void");
            break;
        }
    }

I think you need a custom inspector. Perhaps this Tutorial will help you: Editor Scripting - Unity Learn