Ejemplo n.º 1
0
 // 注销碰撞器
 public void unregisteCollider(IMouseEventCollect obj)
 {
     if (!mAllObjectSet.Contains(obj))
     {
         return;
     }
     if (mHoverWindow == obj)
     {
         mHoverWindow = null;
     }
     if (obj is myUIObject)
     {
         int count = mMouseCastWindowList.Count;
         for (int i = 0; i < count; ++i)
         {
             MouseCastWindowSet item = mMouseCastWindowList[i];
             if (item.hasWindow(obj))
             {
                 item.removeWindow(obj);
                 if (item.isEmpty())
                 {
                     mMouseCastWindowList.Remove(item);
                 }
                 break;
             }
         }
         --mUGUICount;
     }
     else if (obj is MovableObject)
     {
         int count = mMouseCastObjectList.Count;
         for (int i = 0; i < count; ++i)
         {
             MouseCastObjectSet item = mMouseCastObjectList[i];
             if (item.hasObject(obj))
             {
                 item.removeObject(obj);
                 if (item.isEmpty())
                 {
                     mMouseCastObjectList.Remove(item);
                 }
                 break;
             }
         }
         mMovableObjectList.Remove(obj);
     }
     mAllObjectSet.Remove(obj);
     mMouseDownWindowList.Remove(obj);
     mMultiTouchWindowList.Remove(obj);
 }
Ejemplo n.º 2
0
    public void notifyWindowDepthChanged(IMouseEventCollect button)
    {
        // 只判断UI的深度变化
        if (!(button is myUIObject))
        {
            return;
        }
        // 如果之前没有记录过,则不做判断
        if (!mAllObjectSet.Contains(button))
        {
            return;
        }
        int count = mMouseCastWindowList.Count;

        for (int i = 0; i < count; ++i)
        {
            MouseCastWindowSet item = mMouseCastWindowList[i];
            if (item.hasWindow(button))
            {
                item.windowDepthChanged();
                break;
            }
        }
    }