Global Game Jam 2022
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

37 lines
717 B

2 years ago
  1. using System.Collections;
  2. using System.Collections.Generic;
  3. using UnityEngine;
  4. using Variables;
  5. public class CharacterReset : MonoBehaviour, IResettable
  6. {
  7. [SerializeField, Header("References")]
  8. Reference<bool> m_isPlayerDead;
  9. private Vector3 m_startPosition;
  10. private Quaternion m_startRotation;
  11. public void OnLevelLoad()
  12. {
  13. m_startPosition = transform.position;
  14. m_startRotation = transform.rotation;
  15. }
  16. public void OnResetEnd()
  17. {
  18. }
  19. public IEnumerator OnResetStart(float time)
  20. {
  21. transform.position = m_startPosition;
  22. transform.rotation = m_startRotation;
  23. m_isPlayerDead.Value = false;
  24. yield break;
  25. }
  26. }