1234567891011121314151617181920212223242526272829303132333435 |
- #if UNITY_WEBGL && !VUPLEX_DOCS
- using System;
- using UnityEngine;
- using Vuplex.WebView.Internal;
- namespace Vuplex.WebView {
- partial class CanvasWebViewPrefab {
- partial void OnInit() {
- if (_canvas != null && _canvas.renderMode == RenderMode.WorldSpace) {
- throw new InvalidOperationException("2D WebView for WebGL only supports Native 2D Mode, which requires that the Canvas's render mode be set to \"Screen Space - Overlay\" or \"Screen Space - Camera\", but its render mode is instead currently set to \"World Space\". Please change the Canvas's render mode to \"Screen Space - Overlay\" or \"Screen Space - Camera\".");
- }
- if (!Native2DModeEnabled) {
- Native2DModeEnabled = true;
- WebViewLogger.LogWarning("2D WebView for WebGL only supports Native 2D Mode, so CanvasWebViewPrefab.Native2DModeEnabled was automatically set to true.");
- }
- }
- }
- }
- #endif
|