How to make unity think that when on I clicked on a texture I pressed esc?

I’ve got the pause script which, when pressed escape, starts showing the textures. Pause works by setting Time.timeScale from 1 to 0 and 0 to 1, it’s a function togglePause(). It only runs when I press escape. There’s a resume button on the screen - a GUITexture with 2 2D textures, that, when pressed, would have to resume the game again. I thought I should call togglePause() from another script in OnMouseUp(), but instead I figured maybe I can just make it so that when I click it with my mouse, the engine assumes I pressed escape and then togglePause() would run in the other script.

void OnMouseUp() {
Input.GetButtonDown(“pauseButton”);
}
It doesn’t work. Is there any way to make it work, or maybe a good example how to call a function from another script. Using C# as well.

figured it out!