Ejemplo n.º 1
0
        /** 更新。インプットシステム。マウス。マウスホイール。
         */
        private bool Main_InputSystem_Mouse_MouseWheel()
        {
                        #if (USE_DEF_FEE_INPUTSYSTEM)
            {
                UnityEngine_InputSystem.Mouse t_mouse_current = UnityEngine_InputSystem.InputSystem.GetDevice <UnityEngine_InputSystem.Mouse>();
                if (t_mouse_current != null)
                {
                    //デバイス。
                    int t_x = (int)t_mouse_current.scroll.ReadValue().x;
                    int t_y = (int)t_mouse_current.scroll.ReadValue().y;

                    //設定。
                    if (this.is_focus == true)
                    {
                        this.mouse_wheel.Set(t_x, t_y);
                    }
                    else
                    {
                        this.mouse_wheel.Set(0, 0);
                    }

                    return(true);
                }
            }
                        #endif

            return(false);
        }
Ejemplo n.º 2
0
        /** 更新。インプットシステム。マウス。マウス位置。
         */
        private bool Main_InputSystem_Mouse_MousePosition(Fee.Render2D.Render2D a_render2d)
        {
                        #if (USE_DEF_FEE_INPUTSYSTEM)
            {
                UnityEngine_InputSystem.Mouse t_mouse_current = UnityEngine_InputSystem.InputSystem.GetDevice <UnityEngine_InputSystem.Mouse>();
                if (t_mouse_current != null)
                {
                    //デバイス。
                    int t_x;
                    int t_y;
                    {
                        int t_pos_x = (int)t_mouse_current.position.x.ReadValue();

                                                #if ((UNITY_STANDALONE_WIN) || (UNITY_EDITOR_WIN) || (UNITY_ANDROID))
                        int t_pos_y = (int)(this.screen_h - t_mouse_current.position.y.ReadValue());
                                                #else
                        int t_pos_y = (int)(t_mouse_current.position.y.ReadValue());
                                                #endif

                        /*
                         * {
                         *      t_pos_x = (int)((float)t_pos_x * UnityEngine.Screen.width / this.screen_w);
                         *      t_pos_y = (int)((float)t_pos_y * UnityEngine.Screen.height / this.screen_h);
                         * }
                         */

                        //(GUIスクリーン座標)=>(仮想スクリーン座標)。
                        a_render2d.GuiScreenToVirtualScreen(t_pos_x, t_pos_y, out t_x, out t_y);
                    }

                    //設定。
                    this.cursor.Set(t_x, t_y);

                    //devicename
                    this.cursor.devicename = t_mouse_current.displayName;

                    return(true);
                }
            }
                        #endif

            return(false);
        }
Ejemplo n.º 3
0
        /** 更新。インプットシステム。マウス。マウスボタン。
         */
        private bool Main_InputSystem_Mouse_MouseButton()
        {
                        #if (USE_DEF_FEE_INPUTSYSTEM)
            {
                UnityEngine_InputSystem.Mouse t_mouse_current = UnityEngine_InputSystem.InputSystem.GetDevice <UnityEngine_InputSystem.Mouse>();
                if (t_mouse_current != null)
                {
                    //デバイス。
                    bool t_l_on = t_mouse_current.leftButton.isPressed;
                    bool t_r_on = t_mouse_current.rightButton.isPressed;
                    bool t_m_on = t_mouse_current.middleButton.isPressed;

                    //設定。
                    this.left.Set(t_l_on & this.is_focus);
                    this.right.Set(t_r_on & this.is_focus);
                    this.middle.Set(t_m_on & this.is_focus);

                    return(true);
                }
            }
                        #endif

            return(false);
        }
Ejemplo n.º 4
0
        /** 更新。インプットシステム。マウス。タッチ。
         */
        public bool Main_InputSystem_Mouse_Touch(Fee.Render2D.Render2D a_render2d)
        {
                        #if (USE_DEF_FEE_INPUTSYSTEM)
            {
                UnityEngine_InputSystem.Mouse t_mouse_current = UnityEngine_InputSystem.InputSystem.GetDevice <UnityEngine_InputSystem.Mouse>();
                if (t_mouse_current != null)
                {
                    //devicename
                    this.devicename = t_mouse_current.displayName;

                    //device_item_list_count
                    this.device_item_list_count = 0;

                    //リスト作成。
                    if (this.device_item_list.Length < 1)
                    {
                        this.device_item_list = new Touch_Device_Item[1];
                    }

                    if (t_mouse_current.leftButton.isPressed == true)
                    {
                        //デバイス。
                        int t_x;
                        int t_y;
                        {
                            int t_pos_x = (int)t_mouse_current.position.x.ReadValue();

                                                        #if ((UNITY_STANDALONE_WIN) || (UNITY_EDITOR_WIN))
                            int t_pos_y = (int)(this.screen_h - t_mouse_current.position.y.ReadValue());
                                                        #else
                            int t_pos_y = (int)(t_mouse_current.position.y.ReadValue());
                                                        #endif

                            /*
                             * {
                             *      t_pos_x = (int)((float)t_pos_x * UnityEngine.Screen.width / this.screen_w);
                             *      t_pos_y = (int)((float)t_pos_y * UnityEngine.Screen.height / this.screen_h);
                             * }
                             */

                            //(GUIスクリーン座標)=>(仮想スクリーン座標)。
                            a_render2d.GuiScreenToVirtualScreen(t_pos_x, t_pos_y, out t_x, out t_y);
                        }

                        //位置。
                        this.device_item_list[this.device_item_list_count].x = t_x;
                        this.device_item_list[this.device_item_list_count].y = t_y;

                        //フェーズ。
                        this.device_item_list[this.device_item_list_count].phasetype = Touch_Phase.PhaseType.Moved;

                        //フラグ。
                        this.device_item_list[this.device_item_list_count].link = false;

                        //追加情報。
                        this.device_item_list[this.device_item_list_count].touch_raw_id = Touch.INVALID_TOUCH_RAW_ID;

                        this.device_item_list_count++;
                    }

                    return(true);
                }
            }
                        #endif

            return(false);
        }