CrossingExtras.cs 1.3 KB

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