- Home /
Execute different method set in inspector
Hello guys, I am making a button, and I want the button to be able to execute a different functions for different instances so right now whenever the player clicks the button, the Pressed() method is called, and in that method, I want to set some variables and then also set another function that is especified in the inspector, and the only way I know how to call especific functions is througt events, but I dont want to call a function througt an event, but trhough script How can this be done?
public void Pressed()
{
isOn = true;
//public function set in inspector function();
}
if I put something like public Button.ButtonClickedEvent function;
it would I can select a function, but I only want to call it on the Pressed() and not on a onclick event.
Comment
Your answer
