IssueFix_X1.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using System.Collections.Generic;
  2. using System.IO;
  3. using UnityEditor;
  4. using UnityEditor.Callbacks;
  5. using UnityEngine;
  6. using UnityEngine.Rendering;
  7. using Wheels.Unity;
  8. public partial class IssueFix : EditorWindow
  9. {
  10. static bool orientationLandscapeLeft;
  11. static partial void CheckAllIssues_X1()
  12. {
  13. if (PlayerSettings.defaultInterfaceOrientation != UIOrientation.LandscapeLeft)
  14. {
  15. orientationLandscapeLeft = false;
  16. allFixed &= orientationLandscapeLeft;
  17. }
  18. else
  19. {
  20. orientationLandscapeLeft = true;
  21. allFixed &= orientationLandscapeLeft;
  22. }
  23. }
  24. static partial void Fix_X1()
  25. {
  26. FixDefaultOrientation();
  27. }
  28. static void FixDefaultOrientation()
  29. {
  30. PlayerSettings.defaultInterfaceOrientation = UIOrientation.LandscapeLeft;
  31. }
  32. partial void OnGUI_X1()
  33. {
  34. if (!orientationLandscapeLeft)
  35. {
  36. GUILayout.BeginHorizontal();
  37. GUILayout.Label("Default Orientation: ");
  38. GUILayout.FlexibleSpace();
  39. GUILayout.Label("Default Orientation must be 'LandscapeLeft'", label_Red);
  40. if (GUILayout.Button("Fix"))
  41. {
  42. FixDefaultOrientation();
  43. }
  44. GUILayout.EndHorizontal();
  45. }
  46. }
  47. }