Exemple #1
0
 // Update is called once per frame
 void FixedUpdate()
 {
     if (bc.IsTouching(nyusziBC) && waitTime < 0.0f)
     {
         lifescript.DecreaseLife();
         waitTime = 2.0f;
     }
     else
     {
         waitTime -= Time.deltaTime;
     }
 }
Exemple #2
0
    // Update is called once per frame
    void FixedUpdate()
    {
        Vector2 nyusziCurrent = nyuszi.transform.position;

        //if (Vector2.Distance(tr.position, nyusziCurrent) < 0.5f)

        if (rb.IsTouching(nyusziBC))
        {
            lifescript.DecreaseLife();
            Destroy(gameObject);
        }

        if (rb.transform.position.y < startPos.y - 10)
        {
            Destroy(gameObject);
        }
    }