Ejemplo n.º 1
0
        static public void Uninit()
        {
            Device.PlatformServices = null;
            Device.SetIdiom(TargetIdiom.Unsupported);
            Device.Info = null;

            _mainThread    = null;
            _activity      = null;
            _isInitialized = false;
        }
Ejemplo n.º 2
0
        /*-----------------------------------------------------------------*/
        #region Constructor / Dispose

        internal Platform(UnityFormsApplicationActivity activity, Canvas canvas)
        {
            _renderer = canvas.gameObject.AddComponent <PlatformRenderer>();
            _activity = activity;
            _canvas   = canvas;

            var rectTransform = _canvas.GetComponent <RectTransform>();

            rectTransform.ObserveEveryValueChanged(x => new UniRx.Tuple <float, float>(x.rect.width, x.rect.height))
            .Subscribe(_ =>
            {
                _currentPage?.Layout(ContainerBounds);
            })
            .AddTo(_canvas);
        }
Ejemplo n.º 3
0
        /*-----------------------------------------------------------------*/
        #region MonoBehavior

        static public void Init(UnityFormsApplicationActivity activity)
        {
            if (_isInitialized)
            {
                return;
            }

            _mainThread = Thread.CurrentThread;
            _activity   = activity;

            Device.PlatformServices = new UnityPlatformServices();
            Device.SetIdiom(TargetIdiom.Desktop);
            Device.Info = new UnityDeviceInfo();

            Registrar.RegisterAll(new[]
                                  { typeof(ExportRendererAttribute), typeof(ExportCellAttribute), typeof(ExportImageSourceHandlerAttribute) });
            ExpressionSearch.Default = new UnityExpressionSearch();

            _isInitialized = true;
        }