コード例 #1
0
ファイル: UIInput.cs プロジェクト: sknchan/LegacyRust
    internal void OnEvent(UICamera camera, NGUIHack.Event @event, EventType type)
    {
        switch (type)
        {
        case EventType.MouseDown:
        {
            if (@event.button == 0)
            {
                UIUnityEvents.TextClickDown(camera, this, @event, this.label);
            }
            return;
        }

        case EventType.MouseUp:
        {
            if (@event.button != 0)
            {
                Debug.Log("Wee");
            }
            else
            {
                UIUnityEvents.TextClickUp(camera, this, @event, this.label);
            }
            return;
        }

        case EventType.MouseMove:
        {
            return;
        }

        case EventType.MouseDrag:
        {
            if (@event.button == 0)
            {
                UIUnityEvents.TextDrag(camera, this, @event, this.label);
            }
            return;
        }

        case EventType.KeyDown:
        {
            UIUnityEvents.TextKeyDown(camera, this, @event, this.label);
            return;
        }

        case EventType.KeyUp:
        {
            UIUnityEvents.TextKeyUp(camera, this, @event, this.label);
            return;
        }

        default:
        {
            return;
        }
        }
    }
コード例 #2
0
    // Token: 0x06004D74 RID: 19828 RVA: 0x00134284 File Offset: 0x00132484
    internal void OnEvent(global::UICamera camera, NGUIHack.Event @event, EventType type)
    {
        switch (type)
        {
        case 0:
            if (@event.button == 0)
            {
                global::UIUnityEvents.TextClickDown(camera, this, @event, this.label);
            }
            break;

        case 1:
            if (@event.button == 0)
            {
                global::UIUnityEvents.TextClickUp(camera, this, @event, this.label);
            }
            else
            {
                Debug.Log("Wee");
            }
            break;

        case 3:
            if (@event.button == 0)
            {
                global::UIUnityEvents.TextDrag(camera, this, @event, this.label);
            }
            break;

        case 4:
            global::UIUnityEvents.TextKeyDown(camera, this, @event, this.label);
            break;

        case 5:
            global::UIUnityEvents.TextKeyUp(camera, this, @event, this.label);
            break;
        }
    }
コード例 #3
0
ファイル: UIInput.cs プロジェクト: Virobeast2/RCLIENT
    internal void OnEvent(UICamera camera, NGUIHack.Event @event, EventType type)
    {
        switch (type)
        {
        case EventType.MouseDown:
            if (@event.button == 0)
            {
                UIUnityEvents.TextClickDown(camera, this, @event, this.label);
            }
            break;

        case EventType.MouseUp:
            if (@event.button != 0)
            {
                Debug.Log("Wee");
                break;
            }
            UIUnityEvents.TextClickUp(camera, this, @event, this.label);
            break;

        case EventType.MouseDrag:
            if (@event.button == 0)
            {
                UIUnityEvents.TextDrag(camera, this, @event, this.label);
            }
            break;

        case EventType.KeyDown:
            UIUnityEvents.TextKeyDown(camera, this, @event, this.label);
            break;

        case EventType.KeyUp:
            UIUnityEvents.TextKeyUp(camera, this, @event, this.label);
            break;
        }
    }
コード例 #4
0
    // Token: 0x06004EBA RID: 20154 RVA: 0x00145FC0 File Offset: 0x001441C0
    private void OnGUI()
    {
        try
        {
            global::UIUnityEvents.inOnGUI = true;
            GUI.depth = 49;
            global::UIUnityEvents.blankID = GUIUtility.GetControlID(1);
            GUI.SetNextControlName("ngui-unityevents");
            global::UIUnityEvents.controlID = GUIUtility.GetControlID(1);
            GUI.color = Color.clear;
            UnityEngine.Event current = UnityEngine.Event.current;
            EventType         type    = current.type;
            if (type == 2)
            {
                Debug.Log("Mouse Move");
            }
            switch (type)
            {
            case 0:
                if (!global::UIUnityEvents.forbidHandlingNewEvents)
                {
                    bool flag = current.button == 0;
                    using (NGUIHack.Event @event = new NGUIHack.Event(current))
                    {
                        global::UICamera.HandleEvent(@event, type);
                    }
                    if (flag && current.type == 12 && GUIUtility.hotControl == 0)
                    {
                        GUIUtility.hotControl = global::UIUnityEvents.blankID;
                    }
                }
                break;

            case 1:
            {
                bool flag2 = current.button == 0;
                using (NGUIHack.Event event2 = new NGUIHack.Event(current))
                {
                    global::UICamera.HandleEvent(event2, type);
                }
                if (flag2 && GUIUtility.hotControl == global::UIUnityEvents.blankID)
                {
                    GUIUtility.hotControl = 0;
                }
                break;
            }

            case 2:
            case 3:
            case 5:
            case 6:
                using (NGUIHack.Event event3 = new NGUIHack.Event(current))
                {
                    global::UICamera.HandleEvent(event3, type);
                }
                break;

            case 4:
                if (!global::UIUnityEvents.forbidHandlingNewEvents)
                {
                    using (NGUIHack.Event event4 = new NGUIHack.Event(current))
                    {
                        global::UICamera.HandleEvent(event4, type);
                    }
                }
                break;

            case 7:
                if (!global::UIUnityEvents.forbidHandlingNewEvents && global::UIUnityEvents.lastMousePosition != current.mousePosition)
                {
                    global::UIUnityEvents.lastMousePosition = current.mousePosition;
                    using (NGUIHack.Event event5 = new NGUIHack.Event(current, 2))
                    {
                        global::UICamera.HandleEvent(event5, 2);
                    }
                }
                break;

            case 12:
                Debug.Log("Used");
                return;
            }
            if (type == 7)
            {
            }
        }
        finally
        {
            global::UIUnityEvents.inOnGUI = false;
        }
    }
コード例 #5
0
 // Token: 0x06004EB6 RID: 20150 RVA: 0x00145DC4 File Offset: 0x00143FC4
 internal static void TextKeyDown(global::UICamera camera, global::UIInput input, NGUIHack.Event @event, global::UILabel label)
 {
     global::UIUnityEvents.TextKeyDown(camera, input, @event.real, label);
 }
コード例 #6
0
ファイル: UIUnityEvents.cs プロジェクト: HexHash/LegacyRust
 private void OnGUI()
 {
     try
     {
         UIUnityEvents.inOnGUI = true;
         GUI.depth = 49;
         UIUnityEvents.blankID = GUIUtility.GetControlID(FocusType.Keyboard);
         GUI.SetNextControlName("ngui-unityevents");
         UIUnityEvents.controlID = GUIUtility.GetControlID(FocusType.Keyboard);
         GUI.color = Color.clear;
         UnityEngine.Event @event = UnityEngine.Event.current;
         EventType eventType = @event.type;
         if (eventType == EventType.MouseMove)
         {
             Debug.Log("Mouse Move");
         }
         switch (eventType)
         {
             case EventType.MouseDown:
             {
                 if (!UIUnityEvents.forbidHandlingNewEvents)
                 {
                     bool flag = @event.button == 0;
                     using (NGUIHack.Event event1 = new NGUIHack.Event(@event))
                     {
                         UICamera.HandleEvent(event1, eventType);
                     }
                     if (flag && @event.type == EventType.Used && GUIUtility.hotControl == 0)
                     {
                         GUIUtility.hotControl = UIUnityEvents.blankID;
                     }
                 }
                 goto case EventType.DragPerform;
             }
             case EventType.MouseUp:
             {
                 bool flag1 = @event.button == 0;
                 using (NGUIHack.Event event2 = new NGUIHack.Event(@event))
                 {
                     UICamera.HandleEvent(event2, eventType);
                 }
                 if (flag1 && GUIUtility.hotControl == UIUnityEvents.blankID)
                 {
                     GUIUtility.hotControl = 0;
                 }
                 goto case EventType.DragPerform;
             }
             case EventType.MouseMove:
             case EventType.MouseDrag:
             case EventType.KeyUp:
             case EventType.ScrollWheel:
             {
                 using (NGUIHack.Event event3 = new NGUIHack.Event(@event))
                 {
                     UICamera.HandleEvent(event3, eventType);
                 }
                 goto case EventType.DragPerform;
             }
             case EventType.KeyDown:
             {
                 if (!UIUnityEvents.forbidHandlingNewEvents)
                 {
                     using (NGUIHack.Event event4 = new NGUIHack.Event(@event))
                     {
                         UICamera.HandleEvent(event4, eventType);
                     }
                 }
                 goto case EventType.DragPerform;
             }
             case EventType.Repaint:
             {
                 if (!UIUnityEvents.forbidHandlingNewEvents && UIUnityEvents.lastMousePosition != @event.mousePosition)
                 {
                     UIUnityEvents.lastMousePosition = @event.mousePosition;
                     using (NGUIHack.Event event5 = new NGUIHack.Event(@event, EventType.MouseMove))
                     {
                         UICamera.HandleEvent(event5, EventType.MouseMove);
                     }
                 }
                 goto case EventType.DragPerform;
             }
             case EventType.DragUpdated:
             case EventType.DragPerform:
             {
             Label0:
                 eventType != EventType.Repaint;
                 break;
             }
             case EventType.Used:
             {
                 Debug.Log("Used");
                 break;
             }
             default:
             {
                 goto case EventType.DragPerform;
             }
         }
     }
     finally
     {
         UIUnityEvents.inOnGUI = false;
     }
 }
コード例 #7
0
ファイル: UIUnityEvents.cs プロジェクト: Virobeast2/RCLIENT
 internal static void TextKeyUp(UICamera camera, UIInput input, NGUIHack.Event @event, UILabel label)
 {
     TextKeyUp(camera, input, @event.real, label);
 }
コード例 #8
0
ファイル: UIUnityEvents.cs プロジェクト: Virobeast2/RCLIENT
    private void OnGUI()
    {
        try
        {
            inOnGUI   = true;
            GUI.depth = 0x31;
            blankID   = GUIUtility.GetControlID(FocusType.Keyboard);
            GUI.SetNextControlName("ngui-unityevents");
            controlID = GUIUtility.GetControlID(FocusType.Keyboard);
            GUI.color = Color.clear;
            UnityEngine.Event current = UnityEngine.Event.current;
            EventType         type    = current.type;
            if (type == EventType.MouseMove)
            {
                Debug.Log("Mouse Move");
            }
            switch (type)
            {
            case EventType.MouseDown:
                if (!forbidHandlingNewEvents)
                {
                    bool flag = current.button == 0;
                    using (NGUIHack.Event event6 = new NGUIHack.Event(current))
                    {
                        UICamera.HandleEvent(event6, type);
                    }
                    if ((flag && (current.type == EventType.Used)) && (GUIUtility.hotControl == 0))
                    {
                        GUIUtility.hotControl = blankID;
                    }
                }
                break;

            case EventType.MouseUp:
            {
                bool flag2 = current.button == 0;
                using (NGUIHack.Event event7 = new NGUIHack.Event(current))
                {
                    UICamera.HandleEvent(event7, type);
                }
                if (flag2 && (GUIUtility.hotControl == blankID))
                {
                    GUIUtility.hotControl = 0;
                }
                break;
            }

            case EventType.MouseMove:
            case EventType.MouseDrag:
            case EventType.KeyUp:
            case EventType.ScrollWheel:
                using (NGUIHack.Event event4 = new NGUIHack.Event(current))
                {
                    UICamera.HandleEvent(event4, type);
                }
                break;

            case EventType.KeyDown:
                if (!forbidHandlingNewEvents)
                {
                    using (NGUIHack.Event event5 = new NGUIHack.Event(current))
                    {
                        UICamera.HandleEvent(event5, type);
                    }
                }
                break;

            case EventType.Repaint:
                if (!forbidHandlingNewEvents && (lastMousePosition != current.mousePosition))
                {
                    lastMousePosition = current.mousePosition;
                    using (NGUIHack.Event event3 = new NGUIHack.Event(current, EventType.MouseMove))
                    {
                        UICamera.HandleEvent(event3, EventType.MouseMove);
                    }
                }
                break;

            case EventType.Used:
                Debug.Log("Used");
                return;
            }
            if (type == EventType.Repaint)
            {
            }
        }
        finally
        {
            inOnGUI = false;
        }
    }
コード例 #9
0
ファイル: UIUnityEvents.cs プロジェクト: sknchan/LegacyRust
 internal static void TextDrag(UICamera camera, UIInput input, NGUIHack.Event @event, UILabel label)
 {
     UIUnityEvents.TextDrag(camera, input, @event.real, label);
 }
コード例 #10
0
ファイル: UIUnityEvents.cs プロジェクト: sknchan/LegacyRust
    private void OnGUI()
    {
        try
        {
            UIUnityEvents.inOnGUI = true;
            GUI.depth             = 49;
            UIUnityEvents.blankID = GUIUtility.GetControlID(FocusType.Keyboard);
            GUI.SetNextControlName("ngui-unityevents");
            UIUnityEvents.controlID = GUIUtility.GetControlID(FocusType.Keyboard);
            GUI.color = Color.clear;
            UnityEngine.Event @event    = UnityEngine.Event.current;
            EventType         eventType = @event.type;
            if (eventType == EventType.MouseMove)
            {
                Debug.Log("Mouse Move");
            }
            switch (eventType)
            {
            case EventType.MouseDown:
            {
                if (!UIUnityEvents.forbidHandlingNewEvents)
                {
                    bool flag = @event.button == 0;
                    using (NGUIHack.Event event1 = new NGUIHack.Event(@event))
                    {
                        UICamera.HandleEvent(event1, eventType);
                    }
                    if (flag && @event.type == EventType.Used && GUIUtility.hotControl == 0)
                    {
                        GUIUtility.hotControl = UIUnityEvents.blankID;
                    }
                }
                goto case EventType.DragPerform;
            }

            case EventType.MouseUp:
            {
                bool flag1 = @event.button == 0;
                using (NGUIHack.Event event2 = new NGUIHack.Event(@event))
                {
                    UICamera.HandleEvent(event2, eventType);
                }
                if (flag1 && GUIUtility.hotControl == UIUnityEvents.blankID)
                {
                    GUIUtility.hotControl = 0;
                }
                goto case EventType.DragPerform;
            }

            case EventType.MouseMove:
            case EventType.MouseDrag:
            case EventType.KeyUp:
            case EventType.ScrollWheel:
            {
                using (NGUIHack.Event event3 = new NGUIHack.Event(@event))
                {
                    UICamera.HandleEvent(event3, eventType);
                }
                goto case EventType.DragPerform;
            }

            case EventType.KeyDown:
            {
                if (!UIUnityEvents.forbidHandlingNewEvents)
                {
                    using (NGUIHack.Event event4 = new NGUIHack.Event(@event))
                    {
                        UICamera.HandleEvent(event4, eventType);
                    }
                }
                goto case EventType.DragPerform;
            }

            case EventType.Repaint:
            {
                if (!UIUnityEvents.forbidHandlingNewEvents && UIUnityEvents.lastMousePosition != @event.mousePosition)
                {
                    UIUnityEvents.lastMousePosition = @event.mousePosition;
                    using (NGUIHack.Event event5 = new NGUIHack.Event(@event, EventType.MouseMove))
                    {
                        UICamera.HandleEvent(event5, EventType.MouseMove);
                    }
                }
                goto case EventType.DragPerform;
            }

            case EventType.DragUpdated:
            case EventType.DragPerform:
            {
Label0:
                eventType != EventType.Repaint;
                break;
            }

            case EventType.Used:
            {
                Debug.Log("Used");
                break;
            }

            default:
            {
                goto case EventType.DragPerform;
            }
            }
        }
        finally
        {
            UIUnityEvents.inOnGUI = false;
        }
    }