35 lines
593 B
C#
35 lines
593 B
C#
using UnityEngine;
|
|
|
|
public class BoatParking : MonoBehaviour
|
|
{
|
|
private Boat boat;
|
|
|
|
public Transform boatPlaceTransform;
|
|
|
|
public bool isParkingRange;
|
|
|
|
private void Start()
|
|
{
|
|
}
|
|
|
|
private void Update()
|
|
{
|
|
}
|
|
|
|
private void OnTriggerEnter(Collider other)
|
|
{
|
|
if (other.gameObject.layer == LayerMask.NameToLayer("Boat") && other.TryGetComponent<Boat>(out boat))
|
|
{
|
|
isParkingRange = true;
|
|
}
|
|
}
|
|
|
|
private void OnTriggerExit(Collider other)
|
|
{
|
|
if (other.gameObject.layer == LayerMask.NameToLayer("Boat") && other.TryGetComponent<Boat>(out boat))
|
|
{
|
|
isParkingRange = false;
|
|
}
|
|
}
|
|
}
|