123456789101112131415161718192021222324252627282930313233343536373839404142434445 |
- using System;
- using System.Collections.Generic;
- using Roads;
- using UnityEditor;
- using UnityEngine;
- using UnityEngine.Rendering;
- namespace Routes
- {
- [Serializable]
- public struct RouteItem
- {
- [SerializeReference]
- public Turn turn;
- public RoadDirection from;
- public RoadDirection to;
- public void Apply()
- {
- turn.comingFrom = from;
- turn.goingTo = to;
- }
- public void Clear()
- {
- turn.comingFrom = RoadDirection.None;
- turn.goingTo = RoadDirection.None;
- }
- }
-
- public class Route : MonoBehaviour
- {
- public List<RouteItem> items;
- public void Clear()
- {
- items.ForEach(i => i.Clear());
- }
- public void Show()
- {
- items.ForEach(i => i.Apply());
- }
- }
- }
|