// Start is called before the first frame update void Start() { gMRef = GameObject.FindGameObjectWithTag("GameManager").GetComponent <GameManager>(); cardRef = GameObject.FindGameObjectWithTag("Card"); userHandRef = GameObject.FindGameObjectWithTag("User").GetComponentInChildren <UserHand>(); AIHandRef = GameObject.FindGameObjectWithTag("AI").GetComponentInChildren <UserHand>(); pileOfCardsRef = GameObject.FindGameObjectWithTag("PileOfCards").GetComponent <PileOfCardsBehaviour>(); GenerateDeck(deckOfCards); pileOfCardsRef.SetDeck(this.gameObject); userHandRef.SetDeck(this.gameObject); AIHandRef.SetDeck(this.gameObject); }