private void OnTriggerStay2D(Collider2D other)
 {
     if (other.gameObject.tag == "Player")
     {
         if (playerStateDownScr.stateDown == false)
         {
             playerStateDownScr.StateDown();
         }
     }
 }
Exemple #2
0
    private IEnumerator DieCoroutine()
    {
        Time.timeScale = 0.2f;
        playerStateDownScr.StateDown();

        float t = 0f;

        while (t < 1)
        {
            t += Time.deltaTime / 0.25f;
            Time.timeScale = 0.2f + (t * 0.8f);
            yield return(null);
        }

        Time.timeScale = 1f;
    }