12345678910111213141516171819202122232425262728 |
- using System;
- using Pools;
- using UnityEngine;
- namespace Roads
- {
- public class StraightRoadExtras : MonoBehaviour
- {
- public GameObject arcPrefab;
- private GameObject arc;
- private bool hasArc;
- public void ShowArc()
- {
- arc = Instantiate(arcPrefab, transform);
- hasArc = arc != null;
- }
- private void OnTriggerExit(Collider other)
- {
- if (hasArc && other.CompareTag("bike"))
- {
- Destroy(arc);
- }
- }
- }
- }
|