Is there a way we can simulate IMGUI button press?
No, because you can’t create / queue Events manually. So you would need to use a boolean variable instead. Make sure you put it after the actual button
if (GUILayout.Button("MyButton") && someBool)
{
someBool = false;
// your button code
}
If you want to simulate a button press on a button that isn’t yours, you’re out of luck with what the Unity API provides. The only way in this case would be to use native code to move the mouse cursor / simulate a mouse click