VXWebViewAppController.h 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. /**
  2. * Copyright (c) 2021 Vuplex Inc. All rights reserved.
  3. *
  4. * Licensed under the Vuplex Commercial Software Library License, you may
  5. * not use this file except in compliance with the License. You may obtain
  6. * a copy of the License at
  7. *
  8. * https://vuplex.com/commercial-library-license
  9. *
  10. * Unless required by applicable law or agreed to in writing, software
  11. * distributed under the License is distributed on an "AS IS" BASIS,
  12. * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
  13. * See the License for the specific language governing permissions and
  14. * limitations under the License.
  15. */
  16. #import <UIKit/UIKit.h>
  17. #import <Metal/Metal.h>
  18. #import "UnityAppController.h"
  19. #import "UnityInterface.h"
  20. /**
  21. * Extends UnityAppController to override shouldAttachRenderDelegate
  22. * so that it can register a low-level rendering plugin.
  23. *
  24. * Unlike other platforms (like Desktop) where the plugin dynamic library is automatically
  25. * loaded and registered by Unity, that must be done manually on iOS. VXWebViewAppController.mm uses Unity's
  26. * IMPL_APP_CONTROLLER_SUBCLASS() macro to tell Unity to use VXWebViewAppController
  27. * instead of UnityAppController. Due to a design flaw of Unity's plugin system for iOS, it's possible for
  28. * multiple iOS plugins in a project to call IMPL_APP_CONTROLLER_SUBCLASS(), which results in one plugin's use
  29. * of IMPL_APP_CONTROLLER_SUBCLASS() overwriting another's. For instructions on resolving such a conflict,
  30. * please see this support article: https://support.vuplex.com/articles/ios-graphics-plugin-conflict
  31. */
  32. @interface VXWebViewAppController : UnityAppController
  33. /**
  34. * Overrides [UnityAppController shouldAttachRenderDelegate]
  35. * to hook into the Unity trampoline.
  36. */
  37. - (void)shouldAttachRenderDelegate;
  38. + (id<MTLDevice>)metalDevice;
  39. @end