Пример #1
0
    // Update is called once per frame


    void OnCollisionEnter(Collision col)
    {
        if (col.gameObject.tag == "Bullet" && drop_jud == false)
        {
            spawnscript.minus();
            audioSource.PlayOneShot(explosionSound);
            particle = Instantiate(particle_base, transform.position, transform.rotation);
            drop_jud = true;
            gameController.SendMessage("IncreaseScore");
        }

        if (col.gameObject.tag == "Player")
        {
            //GameObject bomb_object = Resources.Load("Bomb") as GameObject;
            //GameObject bomb_instance = Instantiate(bomb_object, new Vector3(this.transform.position.x, enemy_height-10.0f, this.transform.position.z), Quaternion.identity, this.transform);
            gameControllerScript.active_deathCamera();
            audioSource.PlayOneShot(explosionSound);
            particle = Instantiate(particle_base, new Vector3(0, 35.0f, 0), transform.rotation);
            //Debug.Log("over");
            Invoke("Send_GameOver", 0.5f);

            //Destroy(this.gameObject);
        }

        if (col.gameObject.name == "WaterProDaytime")
        {
            //Destroy(particle.gameObject);
            Destroy(this.gameObject);
        }
    }