Beispiel #1
0
 private void OnDestroy()
 {
     StopAllCoroutines();
     BrowserClosedEvent?.Invoke(xsollaBrowser);
     if (mouse != null)
     {
         Destroy(mouse);
         mouse = null;
     }
     if (display != null)
     {
         Destroy(display);
         display = null;
     }
     if (keyboard != null)
     {
         keyboard.EscapePressed -= Keyboard_EscapePressed;
         Destroy(keyboard);
         keyboard = null;
     }
     if (xsollaBrowser != null)
     {
         Destroy(xsollaBrowser);
         xsollaBrowser = null;
     }
 }
Beispiel #2
0
    private void Awake()
    {
        CloseButton.gameObject.SetActive(false);

        Canvas canvas     = FindObjectOfType <Canvas>();
        Rect   canvasRect = (canvas.transform as RectTransform).rect;      //canvas.pixelRect;

        if (Viewport.x > canvasRect.width)
        {
            Viewport.x = canvasRect.width * 0.9F;
        }
        if (Viewport.y > canvasRect.height)
        {
            Viewport.y = canvasRect.height * 0.9F;
        }

        xsollaBrowser           = this.GetOrAddComponent <XsollaBrowser>();
        xsollaBrowser.LogEvent += XsollaBrowser_LogEvent;
        xsollaBrowser.Launch(new LaunchBrowserOptions()
        {
            Width  = (int)Viewport.x,
            Height = (int)Viewport.y,
        });

        display = this.GetOrAddComponent <Display2DBehaviour>();
    }
Beispiel #3
0
    private void Awake()
    {
        canvas       = FindObjectOfType <Canvas>();
        canvasCamera = canvas.worldCamera;

        browserCollider = this.GetOrAddComponent <BoxCollider2D>();
        browserMouse    = gameObject.GetComponent <XsollaBrowser>().Input.Mouse;
        display         = gameObject.GetComponent <Display2DBehaviour>();
    }