コード例 #1
0
 private static bool Message(GameObject target, GameObject parameter, string messageName, GameObject scan, DragEventKind kind, ref bool drop)
 {
     if (target != null)
     {
         GameObject    scanItem = DropNotification.scanItem;
         bool          stopDrag = DropNotification.stopDrag;
         DragEventKind inDrag   = DropNotification.inDrag;
         try
         {
             DropNotification.scanItem = scan;
             DropNotification.stopDrag = drop;
             DropNotification.inDrag   = kind;
             target.NGUIMessage(messageName, parameter);
             drop = DropNotification.stopDrag;
             return(true);
         }
         finally
         {
             DropNotification.scanItem = scanItem;
             DropNotification.stopDrag = stopDrag;
             DropNotification.inDrag   = inDrag;
         }
     }
     return(false);
 }
コード例 #2
0
    private static bool Message(GameObject target, string messageName, GameObject scan, DragEventKind kind, ref bool drop)
    {
        bool flag;

        if (!target)
        {
            return(false);
        }
        GameObject    gameObject    = DropNotification.scanItem;
        bool          flag1         = DropNotification.stopDrag;
        DragEventKind dragEventKind = DropNotification.inDrag;

        try
        {
            DropNotification.scanItem = scan;
            DropNotification.stopDrag = drop;
            DropNotification.inDrag   = kind;
            target.NGUIMessage(messageName);
            drop = DropNotification.stopDrag;
            flag = true;
        }
        finally
        {
            DropNotification.scanItem = gameObject;
            DropNotification.stopDrag = flag1;
            DropNotification.inDrag   = dragEventKind;
        }
        return(flag);
    }
コード例 #3
0
 internal static bool DropMessage(ref DropNotificationFlags flags, DragEventKind kind, GameObject Pressed, GameObject Released)
 {
     bool flag;
     bool flag1;
     string str;
     string str1;
     DropNotificationFlags dropNotificationFlag;
     DropNotificationFlags dropNotificationFlag1;
     DropNotificationFlags dropNotificationFlag2;
     switch (kind)
     {
         case DragEventKind.Drag:
         {
             flag = true;
             if (!Released)
             {
                 flag1 = false;
                 dropNotificationFlag = (DropNotificationFlags)-2147483648;
                 dropNotificationFlag2 = DropNotificationFlags.DragLandOutside;
                 dropNotificationFlag1 = DropNotificationFlags.DragLandOutside;
                 str = "----";
                 str1 = "OnLandOutside";
             }
             else
             {
                 flag1 = true;
                 dropNotificationFlag = DropNotificationFlags.DragDrop;
                 dropNotificationFlag1 = DropNotificationFlags.DragLand;
                 dropNotificationFlag2 = DropNotificationFlags.DragReverse;
                 str = "OnDrop";
                 str1 = "OnLand";
             }
             break;
         }
         case DragEventKind.Alt:
         {
             flag1 = true;
             flag = false;
             dropNotificationFlag = DropNotificationFlags.AltDrop;
             dropNotificationFlag1 = DropNotificationFlags.AltLand;
             dropNotificationFlag2 = DropNotificationFlags.AltReverse;
             str = "OnAltDrop";
             str1 = "OnAltLand";
             break;
         }
         case DragEventKind.Mid:
         {
             flag1 = true;
             flag = false;
             dropNotificationFlag = DropNotificationFlags.MidDrop;
             dropNotificationFlag1 = DropNotificationFlags.MidLand;
             dropNotificationFlag2 = DropNotificationFlags.MidReverse;
             str = "OnMidDrop";
             str1 = "OnMidLand";
             break;
         }
         default:
         {
             throw new ArgumentOutOfRangeException();
         }
     }
     if (((int)flags & (int)dropNotificationFlag2) != (int)dropNotificationFlag2)
     {
         if (((int)flags & (int)dropNotificationFlag) == (int)dropNotificationFlag)
         {
             if (!flag1)
             {
                 DropNotification.Message(Released, str, Pressed, kind, ref flag);
             }
             else
             {
                 DropNotification.Message(Released, Pressed, str, Pressed, kind, ref flag);
             }
         }
         if (((int)flags & (int)dropNotificationFlag1) == (int)dropNotificationFlag1)
         {
             if (!flag1)
             {
                 DropNotification.Message(Pressed, str1, Pressed, kind, ref flag);
             }
             else
             {
                 DropNotification.Message(Pressed, Released, str1, Pressed, kind, ref flag);
             }
         }
     }
     else
     {
         if (((int)flags & (int)dropNotificationFlag1) == (int)dropNotificationFlag1)
         {
             if (!flag1)
             {
                 DropNotification.Message(Pressed, str1, Pressed, kind, ref flag);
             }
             else
             {
                 DropNotification.Message(Pressed, Released, str1, Pressed, kind, ref flag);
             }
         }
         if (((int)flags & (int)dropNotificationFlag) == (int)dropNotificationFlag)
         {
             if (!flag1)
             {
                 DropNotification.Message(Released, str, Pressed, kind, ref flag);
             }
             else
             {
                 DropNotification.Message(Released, Pressed, str, Pressed, kind, ref flag);
             }
         }
     }
     return flag;
 }
コード例 #4
0
 private static bool Message(GameObject target, string messageName, GameObject scan, DragEventKind kind, ref bool drop)
 {
     bool flag;
     if (!target)
     {
         return false;
     }
     GameObject gameObject = DropNotification.scanItem;
     bool flag1 = DropNotification.stopDrag;
     DragEventKind dragEventKind = DropNotification.inDrag;
     try
     {
         DropNotification.scanItem = scan;
         DropNotification.stopDrag = drop;
         DropNotification.inDrag = kind;
         target.NGUIMessage(messageName);
         drop = DropNotification.stopDrag;
         flag = true;
     }
     finally
     {
         DropNotification.scanItem = gameObject;
         DropNotification.stopDrag = flag1;
         DropNotification.inDrag = dragEventKind;
     }
     return flag;
 }
コード例 #5
0
    internal static bool DropMessage(ref DropNotificationFlags flags, DragEventKind kind, GameObject Pressed, GameObject Released)
    {
        bool   flag;
        bool   flag2;
        string str;
        string str2;
        DropNotificationFlags dragDrop;
        DropNotificationFlags dragLand;
        DropNotificationFlags dragReverse;

        switch (kind)
        {
        case DragEventKind.Drag:
            flag = true;
            if (Released == null)
            {
                flag2       = false;
                dragDrop    = -2147483648;
                dragReverse = DropNotificationFlags.DragLandOutside;
                dragLand    = DropNotificationFlags.DragLandOutside;
                str         = "----";
                str2        = "OnLandOutside";
                break;
            }
            flag2       = true;
            dragDrop    = DropNotificationFlags.DragDrop;
            dragLand    = DropNotificationFlags.DragLand;
            dragReverse = DropNotificationFlags.DragReverse;
            str         = "OnDrop";
            str2        = "OnLand";
            break;

        case DragEventKind.Alt:
            flag2       = true;
            flag        = false;
            dragDrop    = DropNotificationFlags.AltDrop;
            dragLand    = DropNotificationFlags.AltLand;
            dragReverse = DropNotificationFlags.AltReverse;
            str         = "OnAltDrop";
            str2        = "OnAltLand";
            break;

        case DragEventKind.Mid:
            flag2       = true;
            flag        = false;
            dragDrop    = DropNotificationFlags.MidDrop;
            dragLand    = DropNotificationFlags.MidLand;
            dragReverse = DropNotificationFlags.MidReverse;
            str         = "OnMidDrop";
            str2        = "OnMidLand";
            break;

        default:
            throw new ArgumentOutOfRangeException();
        }
        if ((flags & dragReverse) == dragReverse)
        {
            if ((flags & dragLand) == dragLand)
            {
                if (flag2)
                {
                    Message(Pressed, Released, str2, Pressed, kind, ref flag);
                }
                else
                {
                    Message(Pressed, str2, Pressed, kind, ref flag);
                }
            }
            if ((flags & dragDrop) == dragDrop)
            {
                if (flag2)
                {
                    Message(Released, Pressed, str, Pressed, kind, ref flag);
                    return(flag);
                }
                Message(Released, str, Pressed, kind, ref flag);
            }
            return(flag);
        }
        if ((flags & dragDrop) == dragDrop)
        {
            if (flag2)
            {
                Message(Released, Pressed, str, Pressed, kind, ref flag);
            }
            else
            {
                Message(Released, str, Pressed, kind, ref flag);
            }
        }
        if ((flags & dragLand) == dragLand)
        {
            if (flag2)
            {
                Message(Pressed, Released, str2, Pressed, kind, ref flag);
                return(flag);
            }
            Message(Pressed, str2, Pressed, kind, ref flag);
        }
        return(flag);
    }
コード例 #6
0
    internal static bool DropMessage(ref DropNotificationFlags flags, DragEventKind kind, GameObject Pressed, GameObject Released)
    {
        bool   flag;
        bool   flag1;
        string str;
        string str1;
        DropNotificationFlags dropNotificationFlag;
        DropNotificationFlags dropNotificationFlag1;
        DropNotificationFlags dropNotificationFlag2;

        switch (kind)
        {
        case DragEventKind.Drag:
        {
            flag = true;
            if (!Released)
            {
                flag1 = false;
                dropNotificationFlag  = (DropNotificationFlags) - 2147483648;
                dropNotificationFlag2 = DropNotificationFlags.DragLandOutside;
                dropNotificationFlag1 = DropNotificationFlags.DragLandOutside;
                str  = "----";
                str1 = "OnLandOutside";
            }
            else
            {
                flag1 = true;
                dropNotificationFlag  = DropNotificationFlags.DragDrop;
                dropNotificationFlag1 = DropNotificationFlags.DragLand;
                dropNotificationFlag2 = DropNotificationFlags.DragReverse;
                str  = "OnDrop";
                str1 = "OnLand";
            }
            break;
        }

        case DragEventKind.Alt:
        {
            flag1 = true;
            flag  = false;
            dropNotificationFlag  = DropNotificationFlags.AltDrop;
            dropNotificationFlag1 = DropNotificationFlags.AltLand;
            dropNotificationFlag2 = DropNotificationFlags.AltReverse;
            str  = "OnAltDrop";
            str1 = "OnAltLand";
            break;
        }

        case DragEventKind.Mid:
        {
            flag1 = true;
            flag  = false;
            dropNotificationFlag  = DropNotificationFlags.MidDrop;
            dropNotificationFlag1 = DropNotificationFlags.MidLand;
            dropNotificationFlag2 = DropNotificationFlags.MidReverse;
            str  = "OnMidDrop";
            str1 = "OnMidLand";
            break;
        }

        default:
        {
            throw new ArgumentOutOfRangeException();
        }
        }
        if (((int)flags & (int)dropNotificationFlag2) != (int)dropNotificationFlag2)
        {
            if (((int)flags & (int)dropNotificationFlag) == (int)dropNotificationFlag)
            {
                if (!flag1)
                {
                    DropNotification.Message(Released, str, Pressed, kind, ref flag);
                }
                else
                {
                    DropNotification.Message(Released, Pressed, str, Pressed, kind, ref flag);
                }
            }
            if (((int)flags & (int)dropNotificationFlag1) == (int)dropNotificationFlag1)
            {
                if (!flag1)
                {
                    DropNotification.Message(Pressed, str1, Pressed, kind, ref flag);
                }
                else
                {
                    DropNotification.Message(Pressed, Released, str1, Pressed, kind, ref flag);
                }
            }
        }
        else
        {
            if (((int)flags & (int)dropNotificationFlag1) == (int)dropNotificationFlag1)
            {
                if (!flag1)
                {
                    DropNotification.Message(Pressed, str1, Pressed, kind, ref flag);
                }
                else
                {
                    DropNotification.Message(Pressed, Released, str1, Pressed, kind, ref flag);
                }
            }
            if (((int)flags & (int)dropNotificationFlag) == (int)dropNotificationFlag)
            {
                if (!flag1)
                {
                    DropNotification.Message(Released, str, Pressed, kind, ref flag);
                }
                else
                {
                    DropNotification.Message(Released, Pressed, str, Pressed, kind, ref flag);
                }
            }
        }
        return(flag);
    }