private void SetPosition()
    {
        Debug.Log($">> height {Screen.height }   safeArea {Screen.safeArea.height}");
        var newscale = new Vector2(Screen.safeArea.width * 0.5f, Screen.safeArea.height);

        newscale = new Vector2(100, 100);

        var newCenter = Screen.safeArea.center;

        Debug.Log($">> safeArea.center {newCenter}");
        //newCenter = new Vector2(0, 0);

        newCenter = new Vector3(0, Screen.safeArea.height - Screen.height, 0);
        //newCenter = new Vector3(0, -300, 0);

        //3040 - 2891 = 149
        //1520 - 1445.5 = 74.5


        ObjectTest(newCenter);

        Debug.Log($">> newCenter {newCenter}");
        webViewObject.SetCenterPositionWithScale(newCenter, newscale);

        webViewObject.SetVisibility(showWebview);
    }
Esempio n. 2
0
    private void Initialize()
    {
        if (webViewObject != null)
        {
            webViewObject.SetVisibility(true);
        }
        else
        {
            webViewObject = (new GameObject("WebViewObject")).AddComponent <WebViewObject>();

            webViewObject.Init(ld: (msg) =>
            {
                Debug.Log(string.Format("CallOnLoaded[{0}]", msg));
                URL = msg;
            });

            webViewObject.SetCenterPositionWithScale(Vector2.zero + Vector2.up * Screen.height * 0.1f, new Vector2(Screen.width, Screen.height * 0.8f));

            webViewObject.SetVisibility(true);

            webViewObject.AddCustomHeader("QWE", "!");

            webViewObject.LoadURL(URL);

            UIInstance.instance.StartTutorial();
        }

        Time.timeScale = 0;
    }
 static int QPYX_SetCenterPositionWithScale_YXQP(IntPtr L_YXQP)
 {
     try
     {
         ToLua.CheckArgsCount(L_YXQP, 3);
         WebViewObject       QPYX_obj_YXQP  = (WebViewObject)ToLua.CheckObject <WebViewObject>(L_YXQP, 1);
         UnityEngine.Vector2 QPYX_arg0_YXQP = ToLua.ToVector2(L_YXQP, 2);
         UnityEngine.Vector2 QPYX_arg1_YXQP = ToLua.ToVector2(L_YXQP, 3);
         QPYX_obj_YXQP.SetCenterPositionWithScale(QPYX_arg0_YXQP, QPYX_arg1_YXQP);
         return(0);
     }
     catch (Exception e_YXQP)                {
         return(LuaDLL.toluaL_exception(L_YXQP, e_YXQP));
     }
 }