Exemplo n.º 1
0
    // Despawnt den Gegner und Spawnt den Punktetext
    public void DestroyEnemy()
    {
        if (health == 0)
        {
            pointsText = Instantiate(Resources.Load("Punkte-Text"),
                                     gameObject.transform.position,
                                     Quaternion.identity) as GameObject;
            pointsText.AddComponent <UIPoints>();

            uicontroller.AddToScore(30);
            pointsText.GetComponent <UIPoints>().Points(30, gameObject.transform.position);

            GameObject.Find("Player").GetComponent <AudioFX>().duck.Play();

            ors.DeleteEnemy(gameObject);
            Destroy(gameObject);
        }
    }
Exemplo n.º 2
0
    // Despawnt den Gegner und Spawnt den Punktetext
    public void DestroyEnemy()
    {
        if (health == 0)
        {
            pointsText = Instantiate(Resources.Load("Punkte-Text"),
                                     gameObject.transform.position,
                                     Quaternion.identity) as GameObject;
            pointsText.AddComponent <UIPoints>();

            if (gameObject.tag != "Boss")
            {
                uicontroller.AddToScore(10);
                pointsText.GetComponent <UIPoints>().Points(10, gameObject.transform.position);
            }
            else
            {
                uicontroller.AddToScore(100);
                pointsText.GetComponent <UIPoints>().Points(100, gameObject.transform.position);
            }

            if (gameObject.name == "Cow(Clone)")
            {
                GameObject.Find("Player").GetComponent <AudioFX>().cow.Play();
            }
            else if (gameObject.name == "Sheep(Clone)")
            {
                GameObject.Find("Player").GetComponent <AudioFX>().sheep.Play();
            }
            else if (gameObject.name == "Cow large(Clone)")
            {
                GameObject.Find("Player").GetComponent <AudioFX>().megaCow.Play();
            }

            ors.DeleteEnemy(gameObject);
            Destroy(gameObject);
        }
    }
Exemplo n.º 3
0
    // Despawnt den Gegner und Spawnt den Punktetext
    public void DestroyEnemy()
    {
        if (health == 0)
        {
            pointsText = Instantiate(Resources.Load("Punkte-Text"),
                                     gameObject.transform.position,
                                     Quaternion.identity) as GameObject;
            pointsText.AddComponent <UIPoints>();

            if (gameObject.tag != "Boss")
            {
                uicontroller.AddToScore(10);
                pointsText.GetComponent <UIPoints>().Points(10, gameObject.transform.position);
            }
            else
            {
                uicontroller.AddToScore(100);
                pointsText.GetComponent <UIPoints>().Points(100, gameObject.transform.position);
            }

            ors.DeleteEnemy(gameObject);
            Destroy(gameObject);
        }
    }