Example #1
0
        void OnTriggerEnter2D(Collider2D coll)
        {
            // Food?
            if (coll.tag == "Food")
            {
                // Get longer in next Move call
                ate = true;

                // Remove the Food
                Destroy(coll.gameObject);

                gameManager.UpdateScore();
            }
            // Collided with Tail or Border
            else if (coll.tag == "Border" || coll.tag == "Tail")
            {
                gameManager.EndGame();
            }
        }