Search code examples
unity-game-engineunityscriptunity3d-2dtools

How to create a menu form with different buttons from a unity sprite without using NGUI


I want to create a main menu in Unity3d for which I have taken a sprite as main menu window and many small sprites as buttons. I wish to write a script that I want to attach to my main menu and that will detect which button is clicked and what function to call. But I don't know how to do that. Can anybody help me?


Solution

  • I think the quickest option would be to display the sprites and add a "OnMouseDown()" script, you only need a collider on it.

    More information: OnMouseDown()