Exemple #1
0
    public void Reset()
    {
        foreach (InventorySlot s in Slots)
        {
            s.ItemImage.transform.position = s.firstPostion;
            s.CheckForDrag = false;
        }

        DraggingOver = null;
        Dragging     = false;
        if (Popup != null)
        {
            Destroy(Popup.gameObject);
            Popup = null;
        }
        CurrentlyDragging = null;
    }
Exemple #2
0
    public void OnPointerEnter(PointerEventData eventData)
    {
        this.GetComponent <Image>().color = Color.white;
        Screen.DraggingOver = this;
        if (Screen.Popup != null && !Screen.Dragging)
        {
            Destroy(Screen.Popup.gameObject);
            Screen.Popup = null;
        }
        if (ItemRepresenting && !Screen.Dragging)
        {
            GameObject     go  = Resources.Load("Items/UI/UIHoverPopup") as GameObject;
            ItemHoverPopup pop = (Instantiate(go) as GameObject).GetComponent <ItemHoverPopup>();
            pop.transform.SetParent(Screen.transform);
            pop.PopupText.text  = ItemRepresenting.UIName;
            pop.PopupText.color = ItemRepresenting.GetTextColor();

            Screen.Popup = pop;
        }
    }