8/2/2023 0 Comments Full auto mouse clicks unity![]() ![]() Now it should work with a single click.Īs soon as the user pushes the UI button down, an onclick JavaScript event is registered for the whole page, so when user releases the mouse button somewhere over the page, a pure JavaScript onclick event handler is executed, where it is now possible to execute a privileged operation. ![]() You should just use onPointerDown event instead of onClick.Ĭreate a UI Button, add a Event - Event Trigger component for this button, add Pointer Down event to the Event Trigger component, assign your function (with Screen.fullScreen = !Screen.fullScreen) to the Pointer Down event. The problem is that Unity UI events go through an intermediate input queue, and are processed some time after their corresponding JavaScript handlers exit. ![]() Switching to fullscreen in a browser requires special privileges and can only be performed from an event handler initiated by the user. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |