Invoke method from other script which is defined by string

Hi, I’m trying to find a way to call methods throughout my project scenes, and not addressing them directly, but finding out which one I need in the process. This is an example of what I have:

private Vector3 setPosition;

private void Update ()
{
if (Input.GetMouseButton(0))
        {          
             setPosition = SetPosition(Input.mousePosition);
}

public Vector3 SetPosition(Vector3 setPosition)
{
Ray ray = Camera.main.ScreenPointToRay(movingPosition);
        RaycastHit hitInfo;
        if (Physics.Raycast(ray, out hitInfo))
        {          
            string name = hitInfo.collider.transform.name;    //name = "Thing"      
            string tag = hitInfo.collider.transform.tag; // tag = "One"
            string scene = SceneManager.GetActiveScene().name; // scene = "First"
if (tag == "One")
            {              
                Invoke(scene + "_Manager." + name + "()",0f);
// I need to call First_Manager.Thing(), where First_Manager is another script and Thing() is method in it
            }
}

This Invoke doesn’t work obviously. The issue that the script with this code is attached to game object that will be the same throughout many scenes, and I need to address methods in respective scripts attached to game objects from most of them. For example I have scenes First and Second, and they have scripts First_Manager and Second_Manager, can I invoke or call method from there somehow? Thank you.

This sounds like an XY problem.

This name/string-based approach seems unlikely to be a good solution to any common Unity game mechanism.

What exactly are you trying to do?

I wanted the player to perform certain actions to certain groups of objects united under different tags throughout all the scenes in the game when the ray hits them (mouse is clicked on them). So I click, the tag is defined, and I go perfoming actions that should be performed with object of a certain tag from the script attached to this specific scene. The alternative was to create if() for every scene. But I actually managed to do nearly what I wanted by adding button component to all that objects.

Sounds like a possible job for interfaces:

Using Interfaces in Unity3D:

https://discussions.unity.com/t/797745/2

https://discussions.unity.com/t/807699/2

Check Youtube for other tutorials about interfaces and working in Unity3D. It’s a pretty powerful combination.

Thanks, I’ll try.