Exemplo n.º 1
0
    void OnMouseDown()
    {
        bool             isHighlighted    = false;
        MonsterManager   monsterManager   = this.transform.parent.GetComponent <MonsterManager>();
        SkillCardManager skillCardManager = this.transform.GetComponent <SkillCardManager>();

        isHighlighted = monsterManager != null ? monsterManager.CardFaceGlowImage.enabled : skillCardManager.CardFaceGlowImage.enabled;

        if (da != null && da.CanDrag() && isHighlighted)
        {
            dragging     = true;
            draggingThis = this;
            HoverPreview.PreviewsAllowed = false;
            zDisplacement       = -Camera.main.transform.position.z + transform.position.z;
            pointerDisplacement = -transform.position + MouseInWorldCoords();

            da.OnStartDrag();
        }
    }