Tasharen Entertainment Forum
Support => NGUI 3 Support => Topic started by: tora on January 14, 2015, 09:42:35 PM
-
Hello, I am a noob at programming and never really used the stickyPress ability that NGUI had.
I am programming for touch devices with the latest versions of Unity and NGUI
My question is, How do i simulate what stickyPress use to do with OnDragOut() or force the release any button.
#region NGUIFunction
void OnPress (bool isPressed)
{
if(StaticVariables.isTheGamePaused == false)
{
if (isPressed)
{ //if this is a jumping button
if(jumpB)
{ //tell the player to jump
_pI.Jump ();
}
else if(magicB)
{ //start the magic skill
_pI.DoMagic ();
}
else if(shieldB)
{ //start shield
_pI.Shield(isPressed);
}
}
else if(!isPressed && shieldB)
{ //stop shield
_pI.Shield(isPressed);
}
}
}
void OnDragOut()
{ //Release this button
//OnPress (false);
}
#endregion
-
It's an option on the button... "Drag Over" field. UIButton simply adds two functions -- OnDragOver and OnDragOut with one line of code in each. Just check the source code.
-
Thank you, I did not see that. The solution was right in my face... :-[