Вопрос

I have a game that is using GUITextures for buttons but it isn't working on different resoltutions. So I was told NGUI would do it very easily. But I already have the code written for the GUITexture buttons.

How do I do it for NGUI buttons using the same textures? I've searched everywhere and can not find any answers....the NGUI forums are not much help.

Это было полезно?

Решение

Your Gameobject should have any type of collider component then in script do the following:

//Use UIEventListener to bind your gameobject with your desired method 

public GameObject YOUR_BUTTON_GAMEOBJECT;

UIEventListener.Get(YOUR_BUTTON_GAMEOBJECT).onClick += YOUR_METHOD_NAME;


//METHOD SIGNATURES 
void YOUR_METHOD_NAME(GameObject gameObject){
     //On Click Stuff
}

Hope this helps

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top