BoxFacePoints.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #if UNITY_EDITOR
  2. using UnityEngine;
  3. using System;
  4. using System.Collections.Generic;
  5. namespace O3DWB
  6. {
  7. public static class BoxFacePoints
  8. {
  9. #region Private Static Variables
  10. private static readonly BoxFacePoint[] _facePoints;
  11. private static readonly int _count;
  12. #endregion
  13. #region Constructors
  14. static BoxFacePoints()
  15. {
  16. _count = Enum.GetValues(typeof(BoxFacePoint)).Length;
  17. _facePoints = new BoxFacePoint[_count];
  18. _facePoints[(int)BoxFacePoint.Center] = BoxFacePoint.Center;
  19. _facePoints[(int)BoxFacePoint.TopLeft] = BoxFacePoint.TopLeft;
  20. _facePoints[(int)BoxFacePoint.TopRight] = BoxFacePoint.TopRight;
  21. _facePoints[(int)BoxFacePoint.BottomRight] = BoxFacePoint.BottomRight;
  22. _facePoints[(int)BoxFacePoint.BottomLeft] = BoxFacePoint.BottomLeft;
  23. }
  24. #endregion
  25. #region Public Static Properties
  26. public static int Count { get { return _count; } }
  27. #endregion
  28. #region Public Static Functions
  29. public static List<BoxFacePoint> GetAll()
  30. {
  31. return new List<BoxFacePoint>(_facePoints);
  32. }
  33. #endregion
  34. }
  35. }
  36. #endif