Exemplo n.º 1
0
    void OnCollisionEnter(Collision collided)
    {
        if (collided.gameObject.tag == "Enemy")
        {
            collided.gameObject.transform.Rotate(0, 50, 0);
            anim = collided.gameObject.GetComponent("Animator") as Animator;
            anim.SetBool("Alive", false);

            fap         = collided.gameObject.GetComponent("FireAtPlayer") as FireAtPlayer;
            fap.enabled = false;
            Rigidbody enemyRB = collided.gameObject.GetComponent <Rigidbody>();
            //enemyRB.isKinematic = true;
            collided.gameObject.tag = "Dead Enemy";
            score.extraPoints      += 10;
            FindObjectOfType <AudioManager>().Play("Die");
            Destroy(collided.gameObject, 0.95f);
        }

        Destroy(gameObject);
    }
Exemplo n.º 2
0
    // When the boss scene starts
    void Start()
    {
        ChangeTokens(false);
        //Get our spawner and spark gun
        spawner = chargerSpawner.GetComponent<Spawner>();
        gunSpark = projectileSpawner.GetComponent<FireAtPlayer>();

        //Make sure things are in their proper start state
        platformIgniter.enabled = false;

        spawner.enabled = false;
        shield.SetActive(false);
        victorySphere.SetActive(false);

        //Set the lights
        ChangeAtmoLight(atmosphereLights[0], .001f, .1f);

        //Pick our gun.
        gunSpark.PickNextGunType();

        //Get the right plane active.
        if (telePlanes != null && telePlanes.Length > 0)
        {
            telePlanes[activeTelePlane].SetActive(true);
        }
    }