コード例 #1
0
        public override void ResetButtonState(UnityEngine.EventSystems.PointerEventData.InputButton button)
        {
            if (this.isReleased == true && this.ClickCount > 0)
            {
                this.ClickCount = 0;
            }

            this.IsCancelled = false;
            this.isReleased  = false;
        }
コード例 #2
0
    static int QPYX_set_button_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        UnityEngine.EventSystems.PointerEventData QPYX_obj_YXQP = (UnityEngine.EventSystems.PointerEventData)QPYX_o_YXQP;
            UnityEngine.EventSystems.PointerEventData.InputButton QPYX_arg0_YXQP = (UnityEngine.EventSystems.PointerEventData.InputButton)ToLua.CheckObject(L_YXQP, 2, typeof(UnityEngine.EventSystems.PointerEventData.InputButton));
            QPYX_obj_YXQP.button = QPYX_arg0_YXQP;
            return(0);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index button on a nil value"));
        }
    }
コード例 #3
0
    static int QPYX_get_button_YXQP(IntPtr L_YXQP)
    {
        object QPYX_o_YXQP = null;

        try
        {
            QPYX_o_YXQP = ToLua.ToObject(L_YXQP, 1);                        UnityEngine.EventSystems.PointerEventData QPYX_obj_YXQP = (UnityEngine.EventSystems.PointerEventData)QPYX_o_YXQP;
            UnityEngine.EventSystems.PointerEventData.InputButton QPYX_ret_YXQP = QPYX_obj_YXQP.button;
            ToLua.Push(L_YXQP, QPYX_ret_YXQP);
            return(1);
        }
        catch (Exception QPYX_e_YXQP)            {
            return(LuaDLL.toluaL_exception(L_YXQP, QPYX_e_YXQP, QPYX_o_YXQP, "attempt to index button on a nil value"));
        }
    }
コード例 #4
0
    static int set_button(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.EventSystems.PointerEventData             obj  = (UnityEngine.EventSystems.PointerEventData)o;
            UnityEngine.EventSystems.PointerEventData.InputButton arg0 = (UnityEngine.EventSystems.PointerEventData.InputButton)ToLua.CheckObject(L, 2, typeof(UnityEngine.EventSystems.PointerEventData.InputButton));
            obj.button = arg0;
            return(0);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index button on a nil value" : e.Message));
        }
    }
コード例 #5
0
    static int get_button(IntPtr L)
    {
        object o = null;

        try
        {
            o = ToLua.ToObject(L, 1);
            UnityEngine.EventSystems.PointerEventData             obj = (UnityEngine.EventSystems.PointerEventData)o;
            UnityEngine.EventSystems.PointerEventData.InputButton ret = obj.button;
            ToLua.Push(L, ret);
            return(1);
        }
        catch (Exception e)
        {
            return(LuaDLL.toluaL_exception(L, e, o == null ? "attempt to index button on a nil value" : e.Message));
        }
    }
コード例 #6
0
        static StackObject *set_button_32(ILIntepreter __intp, StackObject *__esp, IList <object> __mStack, CLRMethod __method, bool isNewObj)
        {
            CSHotFix.Runtime.Enviorment.AppDomain __domain = __intp.AppDomain;
            StackObject *ptr_of_this_method;
            StackObject *__ret = ILIntepreter.Minus(__esp, 2);

            ptr_of_this_method = ILIntepreter.Minus(__esp, 1);
            UnityEngine.EventSystems.PointerEventData.InputButton value = (UnityEngine.EventSystems.PointerEventData.InputButton) typeof(UnityEngine.EventSystems.PointerEventData.InputButton).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);
            ptr_of_this_method = ILIntepreter.Minus(__esp, 2);
            UnityEngine.EventSystems.PointerEventData instance_of_this_method;
            instance_of_this_method = (UnityEngine.EventSystems.PointerEventData) typeof(UnityEngine.EventSystems.PointerEventData).CheckCLRTypes(StackObject.ToObject(ptr_of_this_method, __domain, __mStack));
            __intp.Free(ptr_of_this_method);

            instance_of_this_method.button = value;

            return(__ret);
        }
コード例 #7
0
 public override void ResetButtonState(UnityEngine.EventSystems.PointerEventData.InputButton button)
 {
 }
コード例 #8
0
 public override bool IsReleased(UnityEngine.EventSystems.PointerEventData.InputButton button)
 {
     return(UnityEngine.Input.GetMouseButtonUp((int)button));
 }
コード例 #9
0
 public static bool checkType(IntPtr l, int p, out UnityEngine.EventSystems.PointerEventData.InputButton o)
 {
     return(checkEnum(l, p, out o));
 }
コード例 #10
0
        private void OnBoardClickRegistered(GameView sender, int coordX, int coordY, UnityEngine.EventSystems.PointerEventData.InputButton btn)
        {
            var model = (GameModel)this._viewToModel[sender];

            if (btn == PointerEventData.InputButton.Left)
            {
                // There is an undergoing placement.
                // This will not select units.
                if (_buildingPlacement != null)
                {
                    var available = !GridManager.Instance.CheckOverlap(coordX, coordY, _buildingPlacement.Width,
                                                                       _buildingPlacement.Height,
                                                                       GridLayers.Buildings | GridLayers.Units);

                    if (available)
                    {
                        model.AddBuilding(_buildingPlacement);
                        _buildingPlacement.Placed    = true;
                        _buildingPlacement           = null;
                        sender.BoardHoverRegistered -= OnBoardHoverRegistered;
                    }
                }
                else
                {
                    bool hit = false;
                    foreach (var selectable in model.Selectables)
                    {
                        // Check given coords with Rectangles of selectables.
                        if (selectable.CheckOverlap(coordX, coordY))
                        {
                            hit = true;
                            if (_currentSelection != null)
                            {
                                _currentSelection.OnDeSelection();
                            }

                            selectable.OnSelection();
                            _currentSelection    = selectable;
                            model.SelectedEntity = selectable;
                            break;
                        }
                    }

                    if (_currentSelection != null && !hit)
                    {
                        _currentSelection.OnDeSelection();
                        _currentSelection    = null;
                        model.SelectedEntity = null;
                    }
                }
            }
            else if (btn == PointerEventData.InputButton.Right)
            {
                if (_currentSelection != null)
                {
                    // Too tired to think something anything near engineering at this point.
                    // Just getting things done.
                    // We have only to entities that get right click commands.
                    if (_currentSelection is SoldierModel)
                    {
                        SoldierModel soldier = (SoldierModel)_currentSelection;
                        var          path    = GridManager.Instance.FindPath(soldier.CoordX, soldier.CoordY, coordX, coordY);

                        if (path != null)
                        {
                            soldier.Path = path;
                        }
                        else
                        {
                            Debug.LogError("Could not find a path.");
                        }
                    }
                    else if (_currentSelection is ProductionBuildingModel)
                    {
                        if (!GridManager.Instance.CheckOverlap(coordX, coordY, 1, 1, GridLayers.Buildings))
                        {
                            ((ProductionBuildingModel)_currentSelection).RallyPoint = new Vector2(coordX, coordY);
                        }
                    }
                }
            }
        }
コード例 #11
0
 public override bool IsReleased(UnityEngine.EventSystems.PointerEventData.InputButton button)
 {
     return(this.isReleased);
 }
コード例 #12
0
 public override bool IsPressed(UnityEngine.EventSystems.PointerEventData.InputButton button)
 {
     return(this.ClickCount > 0);
 }