void OnTriggerEnter2D(Collider2D col)
 {
     if (col.gameObject.tag == "Player")
     {
         audioObj.PlaySound("Boca");
         Destroy(gameObject);
         scoreCounter.Score += VialScore;
     }
 }
Exemple #2
0
    void OnCollisionEnter2D(Collision2D col)
    {
        Rigidbody2D projectyleRB = GetComponent <Rigidbody2D>();

        if (col.gameObject.tag == "Player")
        {
            audioObj.PlaySound("Hit");
            GameObject    player       = col.gameObject;
            PlayerMovment PlayerObject = player.GetComponent <PlayerMovment>();
            if (speedX > 0)
            {
                PlayerObject.pushX += 50;
            }
            else
            {
                PlayerObject.pushX -= 50;
            }
        }
        Destroy(gameObject);
    }
Exemple #3
0
    //neka promena
    #endregion

    /* void OnCollisionEnter2D(Collision2D col)
     * {
     *   if (col.gameObject.layer == 8)
     *   {
     *       if(glideFlag || flyFlag)
     *       {
     *           glideFlag = false;
     *           flyFlag = false;
     *       }
     *   }
     *
     * }*/


    private void DeathTrigger()
    {
        audioObj.PlaySound("Death");
        SetDeath();
    }