Example #1
0
    }    //OnTriggerEnter2Df

    void Update()
    {
        if (!CameraUtility.IsRendererInFrustum(grenadeCollider, cam))
        {
            Destroy(gameObject);
        }
    }
Example #2
0
 void Update()
 {
     Physics2D.IgnoreLayerCollision(11, 16);
     if (!CameraUtility.IsRendererInFrustum(bulletCollider, cam))
     {
         Destroy(gameObject);
     }
 }
 void Update()
 {
     gameManager.updateHealth(currentHealth);
     if (damage)
     {
         spriteRender.color = screenFadeColor;
     }
     else
     {
         spriteRender.color = Color.Lerp(spriteRender.color, Color.white, screenFadeSpeed * Time.deltaTime);
     }
     damage = false;
     if (isDead)
     {
         fader.FadeToDark();
         Physics2D.IgnoreLayerCollision(PLAYER_LAYER_MASK, ENEMY_LAYER_MASK, true);
         playerTransform.position = Vector2.Lerp(playerTransform.position,
                                                 new Vector2(playerTransform.position.x, playerTransform.position.y - 100f), 0.01f * Time.deltaTime);
         playerRdb2.isKinematic = true;
         if (!CameraUtility.IsRendererInFrustum(boxCollider, cam))
         {
             isDestroyed = true;
             Destroy(gameObject);
         }
     }
     if (!isDead)
     {
         if (temp1 != null && !level1Manager.goNextRound)
         {
             fader.FadeToClear();
         }
         if (temp2 != null && !level2Manager.goNextRound)
         {
             fader.FadeToClear();
         }
         if (temp3 != null && !level3Manager.goNextRound)
         {
             fader.FadeToClear();
         }
     }
 }