Beispiel #1
0
        public void Respawn(bool resetHealth, bool useCheckpoint)
        {
            if (resetHealth)
            {
                damageable.SetHealth(damageable.startingHealth);
            }

            //we reset the hurt trigger, as we don't want the player to go back to hurt animation once respawned
            m_Animator.ResetTrigger(m_HashHurtPara);
            if (m_FlickerCoroutine != null)
            {//we stop flcikering for the same reason
                StopFlickering();
            }

            m_Animator.SetTrigger(m_HashRespawnPara);

            if (useCheckpoint && m_LastCheckpoint != null)
            {
                UpdateFacing(m_LastCheckpoint.respawnFacingLeft);
                GameObjectTeleporter.Teleport(gameObject, m_LastCheckpoint.transform.position);
            }
            else
            {
                UpdateFacing(m_StartingFacingLeft);
                GameObjectTeleporter.Teleport(gameObject, m_StartingPosition);
            }
        }
Beispiel #2
0
 public void Respawn(bool resetHealth, bool useCheckpoint)
 {
     if (resetHealth)
     {
         damageable.SetHealth(damageable.startingHealth);
     }
 }