Beispiel #1
0
        void LateUpdate()
        {
            if (!IsVisible || SelectedCardModel == null || !Input.anyKeyDown || CardGameManager.TopMenuCanvas != null)
            {
                return;
            }

            if ((Input.GetKeyDown(Inputs.BluetoothReturn) || Input.GetButtonDown(Inputs.Submit)) && SelectedCardModel.DoubleClickAction != null)
            {
                SelectedCardModel.DoubleClickAction(SelectedCardModel);
            }
            else if (Input.GetButtonDown(Inputs.Page))
            {
                if (Input.GetAxis(Inputs.Page) > 0)
                {
                    IncrementProperty();
                }
                else
                {
                    DecrementProperty();
                }
            }
            else if (Input.GetKeyDown(KeyCode.Escape) || Input.GetButtonDown(Inputs.Cancel))
            {
                SelectedCardModel = null;
            }
        }
        void Update()
        {
            WasVisible = IsVisible;
            if (!IsVisible || SelectedCardModel == null || CardGameManager.Instance.ModalCanvas != null)
            {
                return;
            }

            if (EventSystem.current.currentSelectedGameObject == null && !EventSystem.current.alreadySelecting)
            {
                EventSystem.current.SetSelectedGameObject(gameObject);
            }

            if ((Input.GetKeyDown(Inputs.BluetoothReturn) || Input.GetButtonDown(Inputs.Submit)) && SelectedCardModel.DoubleClickAction != null)
            {
                SelectedCardModel.DoubleClickAction(SelectedCardModel);
            }
            else if (Input.GetButtonDown(Inputs.Sort))
            {
                DecrementProperty();
            }
            else if (Input.GetButtonDown(Inputs.Filter))
            {
                IncrementProperty();
            }
            else if (Input.GetButtonDown(Inputs.Option))
            {
                Zoom = !Zoom;
            }
            else if (Input.GetKeyDown(KeyCode.Escape) || Input.GetButtonDown(Inputs.Cancel))
            {
                SelectedCardModel = null;
            }

            if (Zoom)
            {
                ZoomTime += Time.deltaTime;
            }
            else
            {
                ZoomTime = 0;
            }
        }