Beispiel #1
0
        static int _g_get_functionKey(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.Event gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushboolean(L, gen_to_be_invoked.functionKey);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(1);
        }
Beispiel #2
0
        static int _g_get_isScrollWheel(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.Event __cl_gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushboolean(L, __cl_gen_to_be_invoked.isScrollWheel);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
Beispiel #3
0
        static int _s_set_commandName(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.Event gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);
                gen_to_be_invoked.commandName = LuaAPI.lua_tostring(L, 2);
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
Beispiel #4
0
        static int _s_set_numeric(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.Event __cl_gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);
                __cl_gen_to_be_invoked.numeric = LuaAPI.lua_toboolean(L, 2);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(0);
        }
        static int _s_set_displayIndex(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                UnityEngine.Event __cl_gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);
                __cl_gen_to_be_invoked.displayIndex = LuaAPI.xlua_tointeger(L, 2);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(0);
        }
        static int _s_set_pressure(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                UnityEngine.Event __cl_gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);
                __cl_gen_to_be_invoked.pressure = (float)LuaAPI.lua_tonumber(L, 2);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(0);
        }
        static int _g_get_commandName(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                UnityEngine.Event __cl_gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);
                LuaAPI.lua_pushstring(L, __cl_gen_to_be_invoked.commandName);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
Beispiel #8
0
        static int _g_get_delta(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.Event __cl_gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);
                translator.PushUnityEngineVector2(L, __cl_gen_to_be_invoked.delta);
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(1);
        }
Beispiel #9
0
        static int _s_set_type(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.Event     gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);
                UnityEngine.EventType gen_value; translator.Get(L, 2, out gen_value);
                gen_to_be_invoked.type = gen_value;
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
            return(0);
        }
Beispiel #10
0
        static int _s_set_delta(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

                UnityEngine.Event   __cl_gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);
                UnityEngine.Vector2 __cl_gen_value; translator.Get(L, 2, out __cl_gen_value);
                __cl_gen_to_be_invoked.delta = __cl_gen_value;
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(0);
        }
Beispiel #11
0
        private void HandleDragAndDrop(UnityEngine.Event currentEvent, UnityEngine.Rect dropArea)
        {
            if (currentEvent.type == UnityEngine.EventType.DragExited)
            {
                UnityEditor.DragAndDrop.PrepareStartDrag();
            }
            else if (currentEvent.type == UnityEngine.EventType.DragUpdated ||
                     currentEvent.type == UnityEngine.EventType.DragPerform)
            {
                if (dropArea.Contains(currentEvent.mousePosition))
                {
                    var DDData = GetAkDragDropData();

                    if (currentEvent.type == UnityEngine.EventType.DragUpdated)
                    {
                        UnityEditor.DragAndDrop.visualMode = DDData != null
                                                        ? UnityEditor.DragAndDropVisualMode.Link
                                                        : UnityEditor.DragAndDropVisualMode.Rejected;
                    }
                    else
                    {
                        UnityEditor.DragAndDrop.AcceptDrag();

                        if (DDData != null)
                        {
                            AkUtilities.SetByteArrayProperty(m_guidProperty[0], DDData.guid.ToByteArray());
                            m_IDProperty[0].intValue = DDData.ID;

                            var DDGroupData = DDData as AkDragDropGroupData;
                            if (DDGroupData != null)
                            {
                                if (m_guidProperty.Length > 1)
                                {
                                    AkUtilities.SetByteArrayProperty(m_guidProperty[1], DDGroupData.groupGuid.ToByteArray());
                                }
                                if (m_IDProperty.Length > 1)
                                {
                                    m_IDProperty[1].intValue = DDGroupData.groupID;
                                }
                            }

                            //needed for the undo operation to work
                            UnityEngine.GUIUtility.hotControl = 0;
                        }
                    }

                    currentEvent.Use();
                }
            }
        }
Beispiel #12
0
        public System.Boolean HandleKeyEvent(UnityEngine.Event e)
        {
            //Mock Data:
            if (m_functionCallCounts == null)
            {
                m_functionCallCounts = new Dictionary <string, int>();
            }
            if (!m_functionCallCounts.ContainsKey("Boolean HandleKeyEvent(UnityEngine.Event)"))
            {
                m_functionCallCounts.Add("Boolean HandleKeyEvent(UnityEngine.Event)", 0);
            }
            m_functionCallCounts["Boolean HandleKeyEvent(UnityEngine.Event)"]++;

            throw new NotImplementedException("This function was automatically generated by Mockery and has no real implementation yet.");
        }
Beispiel #13
0
    private void HandleDragAndDrop(UnityEngine.Event currentEvent, UnityEngine.Rect dropArea)
    {
        switch (currentEvent.type)
        {
        case UnityEngine.EventType.DragUpdated:
            if (dropArea.Contains(currentEvent.mousePosition))
            {
                var DDData = GetAkDragDropData();
                UnityEditor.DragAndDrop.visualMode = DDData != null
                                                ? UnityEditor.DragAndDropVisualMode.Link
                                                : UnityEditor.DragAndDropVisualMode.Rejected;
                currentEvent.Use();
            }

            break;

        case UnityEngine.EventType.DragPerform:
            if (dropArea.Contains(currentEvent.mousePosition))
            {
                var DDData = GetAkDragDropData();

                UnityEditor.DragAndDrop.AcceptDrag();
                if (DDData != null)
                {
                    AkUtilities.SetByteArrayProperty(m_guidProperty[0], DDData.guid.ToByteArray());

                    var DDGroupData = DDData as AkDragDropGroupData;
                    if (DDGroupData != null && m_guidProperty.Length > 1)
                    {
                        AkUtilities.SetByteArrayProperty(m_guidProperty[1], DDGroupData.groupGuid.ToByteArray());
                    }

                    //needed for the undo operation to work
                    UnityEngine.GUIUtility.hotControl = 0;
                }

                currentEvent.Use();
            }

            break;

        case UnityEngine.EventType.DragExited:
            // clear dragged data
            UnityEditor.DragAndDrop.PrepareStartDrag();
            break;
        }
    }
        int UnityEngineUIInputField_m_ProcessEvent(RealStatePtr L, int gen_param_count)
        {
            ObjectTranslator translator = this;


            UnityEngine.UI.InputField gen_to_be_invoked = (UnityEngine.UI.InputField)translator.FastGetCSObj(L, 1);


            {
                UnityEngine.Event _e = (UnityEngine.Event)translator.GetObject(L, 2, typeof(UnityEngine.Event));

                gen_to_be_invoked.ProcessEvent(_e);



                return(0);
            }
        }
        static int _m_Use(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.Event __cl_gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);


            try {
                {
                    __cl_gen_to_be_invoked.Use(  );



                    return(0);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
        static int _m_ToString(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.Event __cl_gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);


            try {
                {
                    string __cl_gen_ret = __cl_gen_to_be_invoked.ToString(  );
                    LuaAPI.lua_pushstring(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Beispiel #17
0
        static int _m_KeyboardEvent_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    string _key = LuaAPI.lua_tostring(L, 1);

                    UnityEngine.Event gen_ret = UnityEngine.Event.KeyboardEvent(_key);
                    translator.Push(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Beispiel #18
0
        static int _m_PopEvent_xlua_st_(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);



                {
                    UnityEngine.Event _outEvent = (UnityEngine.Event)translator.GetObject(L, 1, typeof(UnityEngine.Event));

                    bool gen_ret = UnityEngine.Event.PopEvent(_outEvent);
                    LuaAPI.lua_pushboolean(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Beispiel #19
0
        static int _m_GetHashCode(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.Event gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);



                {
                    int gen_ret = gen_to_be_invoked.GetHashCode(  );
                    LuaAPI.xlua_pushinteger(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
Beispiel #20
0
        /// <summary>A convenience method which looks out for mousedown/mouseup events and runs them as Click() and Release().
        /// You'd use this from an OnGUI method.</summary>
        /// <param name='current'>An optional event - usually just Event.current.</param>
        /// <returns>True if it did something with the event.</returns>
        public virtual bool HandleEvent(UnityEngine.Event current)
        {
            UnityEngine.EventType type = current.type;

            // Look out for mouse events:
            if (type == UnityEngine.EventType.MouseUp)
            {
                // Release it:
                SetPressure(current.button, 0f);
            }
            else if (type == UnityEngine.EventType.MouseDown)
            {
                // Press it down:
                SetPressure(current.button, 1f);
            }
            else
            {
                return(false);
            }

            return(true);
        }
        static int _m_GetTypeForControl(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UnityEngine.Event __cl_gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);


            try {
                {
                    int controlID = LuaAPI.xlua_tointeger(L, 2);

                    UnityEngine.EventType __cl_gen_ret = __cl_gen_to_be_invoked.GetTypeForControl(controlID);
                    translator.Push(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Beispiel #22
0
        static int _m_ProcessEvent(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


            UIInput __cl_gen_to_be_invoked = (UIInput)translator.FastGetCSObj(L, 1);


            try {
                {
                    UnityEngine.Event ev = (UnityEngine.Event)translator.GetObject(L, 2, typeof(UnityEngine.Event));

                    bool __cl_gen_ret = __cl_gen_to_be_invoked.ProcessEvent(ev);
                    LuaAPI.lua_pushboolean(L, __cl_gen_ret);



                    return(1);
                }
            } catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
        }
Beispiel #23
0
        static int _m_Equals(RealStatePtr L)
        {
            try {
                ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);


                UnityEngine.Event gen_to_be_invoked = (UnityEngine.Event)translator.FastGetCSObj(L, 1);



                {
                    object _obj = translator.GetObject(L, 2, typeof(object));

                    bool gen_ret = gen_to_be_invoked.Equals(_obj);
                    LuaAPI.lua_pushboolean(L, gen_ret);



                    return(1);
                }
            } catch (System.Exception gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + gen_e));
            }
        }
        static int __CreateInstance(RealStatePtr L)
        {
            ObjectTranslator translator = ObjectTranslatorPool.Instance.Find(L);

            try {
                if (LuaAPI.lua_gettop(L) == 1)
                {
                    UnityEngine.Event __cl_gen_ret = new UnityEngine.Event();
                    translator.Push(L, __cl_gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && LuaTypes.LUA_TNUMBER == LuaAPI.lua_type(L, 2))
                {
                    int displayIndex = LuaAPI.xlua_tointeger(L, 2);

                    UnityEngine.Event __cl_gen_ret = new UnityEngine.Event(displayIndex);
                    translator.Push(L, __cl_gen_ret);

                    return(1);
                }
                if (LuaAPI.lua_gettop(L) == 2 && translator.Assignable <UnityEngine.Event>(L, 2))
                {
                    UnityEngine.Event other = (UnityEngine.Event)translator.GetObject(L, 2, typeof(UnityEngine.Event));

                    UnityEngine.Event __cl_gen_ret = new UnityEngine.Event(other);
                    translator.Push(L, __cl_gen_ret);

                    return(1);
                }
            }
            catch (System.Exception __gen_e) {
                return(LuaAPI.luaL_error(L, "c# exception:" + __gen_e));
            }
            return(LuaAPI.luaL_error(L, "invalid arguments to UnityEngine.Event constructor!"));
        }
Beispiel #25
0
 public Event()
 {
     this.m_Event = UnityEngine.Event.current;
 }
Beispiel #26
0
 public System.Boolean SendEvent(UnityEngine.Event e)
 {
     throw new NotImplementedException("This function was automatically generated by Mockery and has no real implementation yet.");
 }
        /// <summary>
        /// Main entrypoint for processing input events. Call from your RenderWindow's event handlers.
        /// </summary>
        /// <param name="args">SFML input event args: can be MouseMoveEventArgs, SFMLMouseButtonEventArgs, MouseWheelEventArgs, TextEventArgs, SFMLKeyEventArgs.</param>
        /// <returns>True if the event was handled.</returns>
        public bool ProcessMessage(UnityEngine.Event args)
        {
            if (null == m_Canvas)
            {
                return(false);
            }

            if (args.type == UnityEngine.EventType.MouseMove)
            {
                UnityEngine.Vector2 ev    = new UnityEngine.Vector2();
                UnityEngine.Vector2 coord = UnityEngine.Event.current.mousePosition;
                ev.x = (int)Math.Floor(coord.x);
                ev.y = (int)Math.Floor(coord.y);

                int dx = (int)ev.x - m_MouseX;
                int dy = (int)ev.y - m_MouseY;

                m_MouseX = (int)ev.x;
                m_MouseY = (int)ev.y;

                return(m_Canvas.Input_MouseMoved(m_MouseX, m_MouseY, dx, dy));
            }

            if (args.type == UnityEngine.EventType.MouseDown)
            {
                return(m_Canvas.Input_MouseButton((int)args.button, true));
            }

            if (args.type == UnityEngine.EventType.MouseUp)
            {
                return(m_Canvas.Input_MouseButton((int)args.button, false));
            }


            if (args.type == UnityEngine.EventType.ScrollWheel)
            {
                return(m_Canvas.Input_MouseWheel((int)args.delta.y * -60));
            }

            if (args.type == UnityEngine.EventType.KeyDown)
            {
                UnityEngine.Event ev = args;

                if (ev.control && ev.alt && ev.keyCode == UnityEngine.KeyCode.LeftControl)
                {
                    return(false); // this is AltGr
                }
                char ch = TranslateChar(ev.keyCode);
                if (ev.button > -1 && InputHandler.DoSpecialKeys(m_Canvas, ch))
                {
                    return(false);
                }

                Key key = TranslateKeyCode(ev.keyCode);
                if (key == Key.Invalid || key == Key.Space)
                {
                    m_Canvas.Input_Character((char)ev.keyCode);
                    return(InputHandler.HandleAccelerator(m_Canvas, ch));
                }
                return(m_Canvas.Input_Key(key, true));//TODO FIX THIS LAST PARAMETER
            }

            if (args.type == UnityEngine.EventType.KeyUp)
            {
                UnityEngine.Event ev = args;

                if (ev.control && ev.alt && ev.keyCode == UnityEngine.KeyCode.LeftControl)
                {
                    return(false); // this is AltGr
                }
                Key key = TranslateKeyCode(ev.keyCode);
                return(m_Canvas.Input_Key(key, false));//TODO FIX THIS LAST PARAMETER
            }

            throw new ArgumentException("Invalid event args", "args");
        }
Beispiel #28
0
 public static void QueueGameViewInputEvent(UnityEngine.Event evt)
 {
 }