I want to know Is it possible?

Hello, All

I want to connect coroutine with button. If i pressed buttons, coroutine work and if I released buttons, coroutine not work. Now, I already make button and coroutine script. But I don’t know how to write script that connected button. If you know this one, Could you tell me?

if (Input.GetKey(KeyCode.Space))
{
    // Call coroutine here
}

You probably need to be a little more specific of what you’re looking for by providing your sample code.

I modified this project(https://github.com/cre8ivepark/COVID19DataVisualizationHoloLens2), so i want to use button in scene, not the keycode.