- Home /
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.
Answer by PhoenixBlackReal · Aug 23, 2013 at 06:55 PM
figured it out!
well how did you do that?
I want to know, ...
please add more details in the answer.
I want to know how to make engine send data (keys) (not use them).