首页 > 代码库 > 【Unity3D自学记录】NGUI之UIButtonMessage长按

【Unity3D自学记录】NGUI之UIButtonMessage长按

对UIButtonMessage进行修改

void OnPress (bool isPressed)
	{
		if (enabled)
		{
			if (((isPressed && trigger == Trigger.OnPress) ||
				(!isPressed && trigger == Trigger.OnRelease))) Send();
		}
        try
        {
            if (isPressed)
            {
                //按住
            }
            else
            {
                //松手
            }
        }
        catch (Exception e) {
            Debug.Log(e.Message);
        }
	}


【Unity3D自学记录】NGUI之UIButtonMessage长按