Exemplo n.º 1
0
        private void Update()
        {
            if (!running)
            {
                return;
            }

            if (open)
            {
                if (Input.GetMouseButtonDown(1))
                {
                    CloseAlbum();
                }

                pointerEventData          = new PointerEventData(eventSystem);
                pointerEventData.position = Input.mousePosition;
                List <RaycastResult> results = new List <RaycastResult>();
                raycaster.Raycast(pointerEventData, results);
                if (results.Count > 0)
                {
                    cardhover = results[0].gameObject.transform.GetComponent <Card>();
                    if (cardhover != null)
                    {
                        if (cardhover != lastCard)
                        {
                            lastCard = cardhover.cardData;
                            ShowCardDescription();
                        }
                    }
                    else
                    {
                        m_animator.SetBool("CardInfo", false);
                    }
                }
            }
            else
            {
                if (Input.GetMouseButtonDown(1))
                {
                    ShowAlbum();
                }
            }
        }
Exemplo n.º 2
0
 public void Setup(Database.Card cardData)
 {
     this.cardData = cardData;
     GetComponent <Image>().sprite = cardData.front;
 }