// 注册碰撞器,只有注册了的碰撞器才会进行检测 public void registeBoxCollider(txUIObject button, BoxColliderClickCallback clickCallback = null, BoxColliderPressCallback pressCallback = null, BoxColliderHoverCallback hoverCallback = null) { if (mUseGlobalTouch) { if (!mButtonCallbackList.ContainsKey(button)) { ColliderCallBack colliderCallback = new ColliderCallBack(); colliderCallback.mButton = button; colliderCallback.mClickCallback = clickCallback; colliderCallback.mHoverCallback = hoverCallback; colliderCallback.mPressCallback = pressCallback; mButtonCallbackList.Add(button, colliderCallback); UIDepth depth = new UIDepth(button.mLayout.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"); } }
// 注册碰撞器,只有注册了的碰撞器才会进行检测 public void registeBoxCollider(txUIObject button, BoxColliderClickCallback clickCallback = null, BoxColliderHoverCallback hoverCallback = null, BoxColliderPressCallback pressCallback = null) { if (!mButtonCallbackList.ContainsKey(button)) { ColliderCallBack colliderCallback = new ColliderCallBack(); colliderCallback.mButton = button; colliderCallback.mClickCallback = clickCallback; colliderCallback.mHoverCallback = hoverCallback; colliderCallback.mPressCallback = pressCallback; mButtonCallbackList.Add(button, colliderCallback); if (!mButtonOrderList.ContainsKey(button.getDepth())) { mButtonOrderList.Add(button.getDepth(), new List <txUIObject>()); } mButtonOrderList[button.getDepth()].Add(button); } }
public void registeBoxCollider(txUIObject obj, BoxColliderClickCallback clickCallback = null, BoxColliderHoverCallback hoverCallback = null, BoxColliderPressCallback pressCallback = null) { mGlobalTouchSystem.registeBoxCollider(obj, clickCallback, hoverCallback, pressCallback); }