CrossingExtras.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Security.Cryptography;
  5. using Controller.Bicycle;
  6. using JetBrains.Annotations;
  7. using Pools;
  8. using Routes;
  9. using UnityEngine;
  10. namespace Roads
  11. {
  12. [Serializable]
  13. public struct CrossingData
  14. {
  15. public Transform west;
  16. public Transform north;
  17. public Transform east;
  18. public Transform south;
  19. }
  20. public class CrossingExtras : Turn
  21. {
  22. public CrossingData crossingData;
  23. protected override Transform RoadDirectionToTransform(RoadDirection position)
  24. {
  25. switch (position)
  26. {
  27. case RoadDirection.North:
  28. return crossingData.north;
  29. case RoadDirection.West:
  30. return crossingData.west;
  31. case RoadDirection.East:
  32. return crossingData.east;
  33. case RoadDirection.South:
  34. return crossingData.south;
  35. case RoadDirection.None:
  36. throw new ArgumentException("RoadDirection.None not allowed for adding arrows");
  37. default:
  38. throw new ArgumentOutOfRangeException(nameof(position), position, "Wrong Argument for AddArrows");
  39. }
  40. }
  41. }
  42. }