// Use this for initialization



    public void OnCollisionEnter2D(Collision2D other)
    {
        if (other.collider.tag != "ground" && other.collider.tag != "Player" && other.collider.tag != "bullet" && other.collider.tag != "score")
        {
            do_attck(other.gameObject);
            ball_effct.play_effect(other.gameObject);
        }
    }
Exemple #2
0
    // Use this for initialization



    public void OnCollisionEnter2D(Collision2D other)
    {
        if (other.collider.tag != "ground" && other.collider.tag != "Player" && other.collider.tag != "bullet" && other.collider.tag != "score")
        {
            do_attck(other.gameObject);
            ball_effct.play_effect(other.gameObject);

            int nbr = Random.Range(0, 6);

            text_controller.cteatefloatingtext("+" + Gave_etoile(other.gameObject, nbr).ToString(), other.gameObject.transform);
        }
    }
 void OnTriggerEnter2D(Collider2D other)
 {
     if (other.tag != "ground" && other.tag != "Player" && other.tag != "bullet")
     {
         do_attck(other.gameObject);
         ball_effct.play_effect(other.gameObject);
     }
 }
Exemple #4
0
 public void  do_attck(GameObject g)
 {
     temp_tag = g.tag;
     balls    = GameObject.FindGameObjectsWithTag(temp_tag);
     foreach (GameObject bal in balls)
     {
         Destroy(bal);
         ball_effct.play_effect(bal);
     }
     Destroy(this.gameObject);
 }
Exemple #5
0
    public void OnCollisionEnter2D(Collision2D other)
    {
        if (other.collider.tag != "ground" && other.collider.tag != "Player" && other.collider.tag != "bullet")
        {
            explosion.SetActive(true);
            ball_effct.play_effect(this.gameObject);
            shake_cam.shacknow(shake_power, shake_duration);

            Destroy(this.gameObject, 0.05f);
        }
    }