Ejemplo n.º 1
0
    private void OnPlayed(Scr_Card card)
    {
        card.OnPlayed -= OnPlayed;

        setActive(false);

        if (OnTurnEnd != null)
        {
            OnTurnEnd();
        }
    }
Ejemplo n.º 2
0
    public void setActive(bool active)
    {
        Active = active;
        List <Transform> children = getChildren();

        foreach (Transform t in children)
        {
            Scr_Card card = t.GetComponent <Scr_Card>();
            card.setActive(active);
        }
    }
Ejemplo n.º 3
0
    private bool wantedCard(Scr_Card card)
    {
        if (_wantedSuites.Contains(card.Suite))
        {
            _wantedSuites.Remove(card.Suite);

            return(true);
        }

        return(false);
    }
Ejemplo n.º 4
0
    private void CreateCards(int amount, Suite suite, Material mat_suite)
    {
        for (int i = 1; i <= amount; i++)
        {
            Transform card     = Instantiate(card_prefab, this.transform.position, Quaternion.Euler(90, 0, 0), transform);
            Scr_Card  scr_Card = card.GetComponent <Scr_Card>();

            scr_Card.number = ValueOfCard(i, amount);
            scr_Card.Suite  = suite;
            card.GetComponent <Renderer>().material = mat_suite;
            Add(card);
        }
    }
Ejemplo n.º 5
0
    public override bool Add(Transform child)
    {
        bool     result = false;
        Scr_Card card   = child.GetComponent <Scr_Card>();

        if (wantedCard(card))
        {
            result = base.Add(child);

            if (_wantedSuites.Count == 0)
            {
                _tileParent.setScore(getCardValues(), flipped);
            }
        }

        return(result);
    }