Hey,
I will preface this by saying I am using C# for my scripts.
I have a script called ButtonAction. It is derived from MonoBehaviour. It has a function named Respond().
I have a script called LoadScene. It is derived from ButtonAction. It also has a funciton named Respond().
I have a script called PlaySound. It is derived from ButtonAction. It also has a function named Respond().
I have a game object. It has a script named StaticObject attached to it.
In the script StaticObject, I want to have a public variable. This variable must, essentially, be a script. More specifically, a ButtonAction script. More specifically still, the variable must hold a script derived from ButtonAction.
In the script StaticObject, I wish to call the Respond() function of the aforementioned member variable, and have the appropriate function be called.
This is to achieve a system where I can have a Prefab that has the StaticObject script attached to it and I can make many instances of said Prefab but have each one execute a different script when clicked without braking the instance link to the prefab.
Any guidance in achieving this would be appreciated.