Beispiel #1
0
 // 用于接收NGUI处理的输入事件,不经过GlobalTouchSystem
 public void registeBoxColliderNGUI(txUIObject button, UIEventListener.VoidDelegate clickCallback,
                                    UIEventListener.BoolDelegate pressCallback = null, UIEventListener.BoolDelegate hoverCallback = null)
 {
     button.setClickCallback(clickCallback);
     button.setPressCallback(pressCallback);
     button.setHoverCallback(hoverCallback);
 }
Beispiel #2
0
 // 注册碰撞器,只有注册了的碰撞器才会进行检测
 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");
     }
 }