void OnAnswerClicked(bool answer)
    {
        CardMessage        cardMessage;
        TriviaCardsManager triviaCardsManager = gameObject.GetComponentInParent <TriviaCardsManager>();

        if (answer)
        {
            cardMessage = new CardMessage(gameObject, true);
            triviaCardsManager.SendMessage("CardMessageWhenClicked", cardMessage);
        }
        else if (!answer)
        {
            cardMessage = new CardMessage(gameObject, false);
            triviaCardsManager.SendMessage("CardMessageWhenClicked", cardMessage);
        }
    }
Exemple #2
0
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.gameObject.tag == "Bullet")
     {
         other.gameObject.SendMessage("DestroyBullet");
         triviaCardsManager.SendMessage("PlayerHit");
     }
 }