// Could be an attribute. public void SetHand(CardHand hand) { Debug.Log("Hand is now " + hand + " for " + this + "!"); this.rb = this.GetComponent <Rigidbody>(); this.hand = hand; this.rb.isKinematic = (hand != null); }
public void Discard() { this.hand.RemoveCard(this); this.hand = null; // Go to the dealer. LerpTo lt = this.GetComponent <LerpTo>(); lt.Run(this.dealer.transform, true); // Disable colliders. Collider[] cols = this.GetComponents <Collider>(); foreach (Collider col in cols) { col.enabled = false; } this.StartCoroutine(this.DestroySelf()); }