private void OnPlayed(Scr_Card card) { card.OnPlayed -= OnPlayed; setActive(false); if (OnTurnEnd != null) { OnTurnEnd(); } }
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); } }
private bool wantedCard(Scr_Card card) { if (_wantedSuites.Contains(card.Suite)) { _wantedSuites.Remove(card.Suite); return(true); } return(false); }
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); } }
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); }