diff options
author | Neil Kollack <nkollack@gmail.com> | 2022-04-14 21:14:44 -0500 |
---|---|---|
committer | Neil Kollack <nkollack@gmail.com> | 2022-04-14 21:14:44 -0500 |
commit | 80c478b00f090a64ccd63d3252ac02ffa1f7f5a2 (patch) | |
tree | ec0aefd7727a8ae29be0ebac1f2e005283fe1782 /Assets/Scripts/RespawnPoint.cs | |
parent | 15a62795a2f2d9e7311bea4b59430c589125ec79 (diff) |
feat: level complete
Diffstat (limited to 'Assets/Scripts/RespawnPoint.cs')
-rw-r--r-- | Assets/Scripts/RespawnPoint.cs | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Assets/Scripts/RespawnPoint.cs b/Assets/Scripts/RespawnPoint.cs new file mode 100644 index 0000000..6396128 --- /dev/null +++ b/Assets/Scripts/RespawnPoint.cs @@ -0,0 +1,18 @@ +using MontanaJohns.Actors; +using System.Collections; +using System.Collections.Generic; +using UnityEngine; + +public class RespawnPoint : MonoBehaviour +{ + [SerializeField] private Sprite activatedSprite; + + private void OnTriggerEnter2D(Collider2D collision) + { + if (collision.gameObject.tag == "Player") + { + collision.gameObject.GetComponent<Player>().spawnPoint = transform.position; + gameObject.GetComponent<SpriteRenderer>().sprite = activatedSprite; + } + } +} |