UnityView.h 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. #pragma once
  2. @interface UnityRenderingView : UIView
  3. {
  4. }
  5. + (void)InitializeForAPI:(UnityRenderingAPI)api;
  6. @end
  7. @interface UnityView : UnityRenderingView
  8. {
  9. @private ScreenOrientation _curOrientation;
  10. @private BOOL _shouldRecreateView;
  11. @private BOOL _viewIsRotating;
  12. }
  13. // we take scale factor into account because gl backbuffer size depends on it
  14. - (id)initWithFrame:(CGRect)frame scaleFactor:(CGFloat)scale;
  15. - (id)initWithFrame:(CGRect)frame;
  16. - (id)initFromMainScreen;
  17. // in here we will go through subviews and call onUnityUpdateViewLayout selector (if present)
  18. // that allows to handle simple overlay child view layout without doing view controller magic
  19. - (void)layoutSubviews;
  20. - (void)recreateRenderingSurfaceIfNeeded;
  21. - (void)recreateRenderingSurface;
  22. // will match script-side Screen.orientation
  23. @property (nonatomic, readonly) ScreenOrientation contentOrientation;
  24. @end
  25. @interface UnityView (Deprecated)
  26. - (void)recreateGLESSurfaceIfNeeded __deprecated_msg("use recreateRenderingSurfaceIfNeeded instead.");
  27. - (void)recreateGLESSurface __deprecated_msg("use recreateRenderingSurface instead.");
  28. @end
  29. @interface UnityView (Keyboard)
  30. - (void)processKeyboard;
  31. @end
  32. #if PLATFORM_IOS
  33. #include "UnityView+iOS.h"
  34. #elif PLATFORM_TVOS
  35. #include "UnityView+tvOS.h"
  36. #endif
  37. void ReportSafeAreaChangeForView(UIView* view);
  38. // Computes safe area for a view in Unity coordinate system (origin of the view
  39. // is bottom-left, as compared to standard top-left)
  40. CGRect ComputeSafeArea(UIView* view);