// 注册碰撞器,只有注册了的碰撞器才会进行检测 public void registeBoxCollider(txUIObject button, UIClickCallback clickCallback = null, UIPressCallback pressCallback = null, UIHoverCallback hoverCallback = null) { if (mUseGlobalTouch) { button.setClickCallback(clickCallback); button.setPressCallback(pressCallback); button.setHoverCallback(hoverCallback); if (!mButtonCallbackList.Contains(button)) { mButtonCallbackList.Add(button); UIDepth depth = new UIDepth(button.getLayout().getRenderOrder(), button.getDepth()); if (!mButtonOrderList.ContainsKey(depth)) { mButtonOrderList.Add(depth, new List <txUIObject>()); } mButtonOrderList[depth].Add(button); } } // 如果不使用 else { logError("Not Active Global Touch! use public void registeBoxCollider(txUIObject button, " + "UIEventListener.VoidDelegate clickCallback = null,UIEventListener.BoolDelegate pressCallback = null, " + "UIEventListener.BoolDelegate hoverCallback = null) instead"); } }
// 用于接收GlobalTouchSystem处理的输入事件 public void registeBoxCollider(txUIObject obj, UIClickCallback clickCallback = null, UIHoverCallback hoverCallback = null, UIPressCallback pressCallback = null) { mGlobalTouchSystem.registeBoxCollider(obj, clickCallback, pressCallback, hoverCallback); }
public void setHoverCallback(UIHoverCallback callback) { mHoverCallback = callback; }