UnityViewControllerBase.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #pragma once
  2. #import <UIKit/UIKit.h>
  3. #import "PluginBase/UnityViewControllerListener.h"
  4. #if PLATFORM_IOS || PLATFORM_VISIONOS
  5. #define UNITY_VIEW_CONTROLLER_BASE_CLASS UIViewController
  6. #elif PLATFORM_TVOS
  7. #import <GameController/GCController.h>
  8. #define UNITY_VIEW_CONTROLLER_BASE_CLASS GCEventViewController
  9. #endif
  10. @interface UnityViewControllerBase : UNITY_VIEW_CONTROLLER_BASE_CLASS
  11. {
  12. id<UnityViewControllerNotifications> _notificationDelegate;
  13. }
  14. - (void)viewWillLayoutSubviews;
  15. - (void)viewDidLayoutSubviews;
  16. - (void)viewDidDisappear:(BOOL)animated;
  17. - (void)viewWillDisappear:(BOOL)animated;
  18. - (void)viewDidAppear:(BOOL)animated;
  19. - (void)viewWillAppear:(BOOL)animated;
  20. @property (nonatomic, retain) id<UnityViewControllerNotifications> notificationDelegate;
  21. @end
  22. #if PLATFORM_IOS
  23. #include "UnityViewControllerBase+iOS.h"
  24. #elif PLATFORM_TVOS
  25. #include "UnityViewControllerBase+tvOS.h"
  26. #elif PLATFORM_VISIONOS
  27. #include "UnityViewControllerBase+visionos.h"
  28. #endif
  29. // this should be used to create view controller that plays nicely with unity and account for player settings
  30. UnityViewControllerBase* AllocUnityViewController(void);
  31. UnityViewControllerBase* AllocUnityDefaultViewController(void);
  32. #if UNITY_SUPPORT_ROTATION
  33. UnityViewControllerBase* AllocUnitySingleOrientationViewController(UIInterfaceOrientation orient);
  34. #endif