﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using UnityEngine.UI;

public class CardButton : MonoBehaviour {

    private CardManager cardManager;

    private int rank;
	
	void Start () {
        Button btn = this.GetComponent<Button>();
        btn.onClick.AddListener(OnClick);        
	}

    public void initButton(CardManager cardManager, int rank)
    {
        this.cardManager = cardManager;
        this.rank = rank;
    }

    void OnClick()
    {
        cardManager.onCardClick(rank);        
    }
}
