2021-03-03 12:53:52 +00:00
|
|
|
using System;
|
2021-02-15 09:44:04 +00:00
|
|
|
using System.Collections;
|
|
|
|
using System.Collections.Generic;
|
|
|
|
using UnityEngine;
|
|
|
|
using System.Linq;
|
2021-03-03 12:53:52 +00:00
|
|
|
using Ktyl.Util;
|
2021-02-15 09:44:04 +00:00
|
|
|
|
|
|
|
public class SafeZone : MonoBehaviour
|
|
|
|
{
|
2021-03-03 12:53:52 +00:00
|
|
|
[SerializeField] private SerialVector3 _respawnPosition;
|
2021-02-15 09:44:04 +00:00
|
|
|
|
2021-03-03 12:53:52 +00:00
|
|
|
private void OnTriggerStay(Collider other)
|
2021-02-15 09:44:04 +00:00
|
|
|
{
|
2021-02-15 16:23:29 +00:00
|
|
|
// Check if other game object is Player.
|
2021-03-12 11:52:56 +00:00
|
|
|
if (other.gameObject.CompareTag("Player"))
|
2021-02-15 13:14:42 +00:00
|
|
|
{
|
2021-03-03 12:53:52 +00:00
|
|
|
_respawnPosition.Value = other.gameObject.transform.position;
|
2021-02-15 09:44:04 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|