Inheritance: MonoBehaviour
 private void ExplodePortal()
 {
     RaceStageUIController.portalsKilled++;
     rend         = GetComponent <Renderer>();
     rend.enabled = true;
     DeathScream.playDeathScreamPortal();
     Debug.Log("ExplodePortal()");
     GetComponent <MeshExploder>().Explode();
     Destroy(gameObject);
 }
Ejemplo n.º 2
0
 void OnParticalCollision(GameObject other)
 {
     if (other.tag == "Player")
     {
         rend         = GetComponent <Renderer>();
         rend.enabled = true;
         DeathScream.playDeathScreamPortal();
         GetComponent <MeshExploder>().Explode();
         Destroy(gameObject);
     }
 }
 private void ExplodeEnemy()
 {
     GameState.beingShot = false;
     mesh.GetComponent <MeshExploder>().Explode();
     DeathScream.playDeathScreamTripod();
     GameState.tripodsKilled++;
     //transform.parent.gameObject.SetActive(false);
     collided = false;
     gameObject.SetActive(false);
     //transform.parent.gameObject.transform.parent = null;
 }
Ejemplo n.º 4
0
 void OnTriggerEnter(Collider other)
 {
     print(gameObject.GetType());
     if (other.gameObject.tag == "Player")
     {
         rend         = GetComponent <Renderer>();
         rend.enabled = true;
         DeathScream.playDeathScreamPortal();
         GetComponent <MeshExploder>().Explode();
         Destroy(gameObject);
     }
 }
    void Update()
    {
        /*
         * if (Input.GetKey(KeyCode.Q)){
         *      currentHealth--;
         *      laserParticles.Play();
         *      healthPercent = currentHealth / startingHealth;
         *      //healthPercentText = (int)currentHealth / startingHealth * 100;
         *      //Debug.Log(healthPercent);
         *      healthPercentField.text = (int)(healthPercent * 100) + "%";
         *      healthPercentFieldFP.text = (int)(healthPercent * 100) + "%";
         *      healthPercentFieldVR.text = (int)(healthPercent * 100) + "%";
         *      healthPercentFieldFPVR.text = (int)(healthPercent * 100) + "%";
         *      slider.value = healthPercent;
         *      sliderVR.value = healthPercent;
         *      sliderFP.value = healthPercent;
         *      sliderFPVR.value = healthPercent;
         *      //barScript.UpdateValue(currentHealth, startingHealth);
         * }
         */
        //if (TripodShooting.inTrigger == true)
        if (GameState.beingShot == true)
        {
            currentHealth--;
            laserParticles.Play();
            healthPercent = currentHealth / startingHealth;
            //healthPercentText = currentHealth / startingHealth * 100;
            healthPercentField.text     = (int)(healthPercent * 100) + "%";
            healthPercentFieldFP.text   = (int)(healthPercent * 100) + "%";
            healthPercentFieldVR.text   = (int)(healthPercent * 100) + "%";
            healthPercentFieldFPVR.text = (int)(healthPercent * 100) + "%";
            slider.value     = healthPercent;
            sliderVR.value   = healthPercent;
            sliderFP.value   = healthPercent;
            sliderFPVR.value = healthPercent;
            //barScript.UpdateValue(currentHealth, startingHealth);
        }
        else
        {
            laserParticles.Stop();
        }


        if (currentHealth <= 0 && !dead)
        {
            dead = true;
            laserParticles.Stop();
            DeathScream.playDeathScreamCar();
            deathParticles.Play();
            mesh.enabled = false;
            Invoke("EndLevel", 1.9f);
        }
    }
 private void ExplodeEnemy()
 {
     if (destroyPortal != null)
     {
         if (string.Compare(name, "Alien_CyanGlow(Clone)") == 0)
         {
             DeathScream.playDeathScreamCyan();
         }
         if (string.Compare(name, "Alien_YellowGlow(Clone)") == 0)
         {
             DeathScream.playDeathScreamYellow();
         }
         if (string.Compare(name, "Alien_WhiteGlow(Clone)") == 0)
         {
             DeathScream.playDeathScreamWhite();
         }
         if (string.Compare(name, "Mr Grey(Clone)") == 0)
         {
             DeathScream.playDeathScreamGrey();
         }
         destroyPortal.incrementSpawnsKilled();
         GetComponent <MeshExploder>().Explode();
         transform.parent.gameObject.SetActive(false);
         collided = false;
         transform.parent.gameObject.transform.parent = null;
     }
     else
     {
         if (string.Compare(name, "Alien_CyanGlow(Clone)") == 0)
         {
             DeathScream.playDeathScreamCyan();
         }
         if (string.Compare(name, "Alien_YellowGlow(Clone)") == 0)
         {
             DeathScream.playDeathScreamYellow();
         }
         if (string.Compare(name, "Alien_WhiteGlow(Clone)") == 0)
         {
             DeathScream.playDeathScreamWhite();
         }
         if (string.Compare(name, "Mr Grey(Clone)") == 0)
         {
             DeathScream.playDeathScreamGrey();
         }
         DeathScream.playDeathScreamCyan();
         GetComponent <MeshExploder>().Explode();
         transform.parent.gameObject.SetActive(false);
         collided = false;
         transform.parent.gameObject.transform.parent = null;
     }
 }