Esempio n. 1
0
    private void Scored()
    {
        // FILL ME IN
        Color green = new Color(0f, 255f, 0f);

        if (gameObject.GetComponent <SpriteRenderer>().color != green)
        {
            gameObject.GetComponent <SpriteRenderer>().color = green;
            ScoreKeeper.AddToScore(gameObject.GetComponent <Rigidbody2D>().mass);

            //Checking if Robot scene
            if (SceneManager.GetActiveScene().name == "Robot" && GameObject.FindGameObjectWithTag("Bomb"))
            {
                RobotTalk.ChangeText();
            }
        }
    }
Esempio n. 2
0
    void OnCollisionEnter2D(Collision2D collision)
    {
        if (SceneManager.GetActiveScene().name == "Robot" && firstCollision)
        {
            if (firstCollision)
            {
                if (collision.gameObject.tag == "Bomb")
                {
                    RobotTalk.DeathText();
                }
                else
                {
                    RobotTalk.ChangeText();
                }

                firstCollision = false;
            }
        }
    }