예제 #1
0
 private void OnTriggerEnter2D(Collider2D collision)
 {
     if (collision.gameObject.name == "PlayerV2")
     {
         if (flipManager.flipActive != enable)
         {
             flipManager.FlipEnabler(enable);
             if (!enable)
             {
                 flipManager.CancelWarning();
                 if (PlayerJumpV2.instance.isFlipped)
                 {
                     PlayerJumpV2.instance.PlayerFlip();
                 }
             }
         }
         else if (!enable)
         {
             if (PlayerJumpV2.instance.isFlipped)
             {
                 PlayerJumpV2.instance.PlayerFlip();
             }
         }
     }
 }
예제 #2
0
 public void Respawn()
 {
     CursorManager.Instance.ChangeCursor(false);
     Instantiate(deathPFX, gameObject.transform.position, Quaternion.identity);
     gameObject.transform.position = spawnPoint;
     Destroy(SwordSpawner.instance.cloneSword);
     SwordSpawner.instance.cloneSword   = null;
     SwordSpawner.instance.swordSpawned = false;
     PlayerJumpV2.instance.ResetGravity();
     PlayerJumpV2.instance.PlayerNormal();
     if (flipTrigger != null)
     {
         flipTrigger.FlipEnabler(false);
     }
     if (PlayerJumpV2.instance.isFlipped)
     {
         PlayerJumpV2.instance.PlayerFlip();
     }
     Instantiate(deathPFX, transform);
     if (SceneManager.GetActiveScene().name.Contains("LEVEL"))
     {
         if (timer.timerActive)
         {
             deathCount++;
         }
     }
     //CursorManager.Instance.ChangeCursorState(false);
     FindObjectOfType <AudioManager>().Play("Death");
     FindObjectOfType <CameraShaker>().StartCamShakeCoroutine(0.5f, 1f, .5f);
 }