Ejemplo n.º 1
0
    void OnCollisionEnter(Collision col)
    {
        if (col.gameObject.tag == "Wall")
        {
            //Debug.Log(gm);
            ///Debug.Log(gm.GetActiveEnemyNum());
            //Debug.Log(gm.ENEMY_NUM);
            if (tagName == "Player" && GameMgr.ENEMY_NUM > gm.GetActiveEnemyNum())
            {
                gm.Add_Enemy(transform.position);
            }
            Vanish();
        }

        if (col.gameObject.tag == "Enemy" || col.gameObject.tag == "Wall")
        {
            //sound.Play();
            gm.StartExploson(col, 1f);
            //StartCoroutine(gm.Exploson(col.gameObject, 1f));
            //ShotEffect es = ShotEffect.Add(col.transform.position.x, col.transform.position.y, col.transform.position.z);
            //ameObject MakedObject = Instantiate(Effect, col.transform.position, Quaternion.identity) as GameObject;
        }

        if (col.gameObject.tag == "Enemy")
        {
            Vanish();
        }
    }