Ejemplo n.º 1
0
 public void draw()
 {
     if (PlayerDeck[0] != null)
     {
         Transform PHand;
         PHand = GameObject.Find("hand").transform;
         CardInfoPlug TempInfo = CardTemplate.GetComponent <CardInfoPlug>();
         TempInfo.health      = PlayerDeck[0].health;
         TempInfo.attack      = PlayerDeck[0].attack;
         TempInfo.cost        = PlayerDeck[0].cost;
         TempInfo.Description = PlayerDeck[0].Description;
         TempInfo.Name        = PlayerDeck[0].Name;
         TempInfo.Makeit();
         Instantiate(CardTemplate, PHand);
         PlayerDeck.RemoveAt(0);
     }
 }
Ejemplo n.º 2
0
    public void OnDrop(PointerEventData eventData)
    {
        //Debug.Log(eventData.pointerDrag.name + " Was Dropped on " + gameObject.name);
        Draggable    d    = eventData.pointerDrag.GetComponent <Draggable>();
        CardInfoPlug Info = eventData.pointerDrag.GetComponent <CardInfoPlug>();

        if (d != null && d.ParentReturn != this.transform)
        {
            if (PManager.CostCheck(Info.cost))
            {
                d.ParentReturn = this.transform;
            }
        }
        else
        {
            d.ParentReturn = this.transform;
        }
    }