2
« 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