예제 #1
0
    public void OnUnitDrop(DragSource source)
    {
        UnitHolder originalHolder = source.originalParent.GetComponent <UnitHolder>();

        RemovePlayAction(originalHolder.playAction);
        originalHolder.playAction = null;

        GameObject cardObject = CreateCardDisplay(source.GetComponent <UnitUI>().cardData);

        cardObject.transform.position = cardObject.transform.parent.position;

        foreach (DropTarget target in originalHolder.GetComponents <DropTarget>())
        {
            target.enabled = true;
        }

        Destroy(source.gameObject);
        UIManager.instance.ValidateDropCost();
    }
예제 #2
0
    public void OnUnitDrop(DragSource source)
    {
        UnitHolder originalHolder = source.originalParent.GetComponent <UnitHolder>();

        source.transform.SetParent(transform);
        source.transform.position = transform.position;

        handManager.RemovePlayAction(originalHolder.playAction);
        originalHolder.playAction = null;
        playAction = CreatePlayCardAction(source.GetComponent <UnitUI>().cardData);
        handManager.AddPlayAction(playAction);

        foreach (DropTarget target in GetComponents <DropTarget>())
        {
            target.enabled = false;
        }
        foreach (DropTarget target in originalHolder.GetComponents <DropTarget>())
        {
            target.enabled = true;
        }
    }