コード例 #1
0
    void OnMouseDown()
    {
        StringBuilder builder = new StringBuilder();

        builder.AppendLine("AR Toolkit Version " + PluginFunctions.arwGetARToolKitVersion());
        builder.AppendLine("Running?: " + PluginFunctions.arwIsRunning());

        int    width;
        int    height;
        int    pixelSize;
        string pixelFormatString;

        PluginFunctions.arwGetVideoParams(out width, out height, out pixelSize, out pixelFormatString);
        builder.AppendLine("VideoParams: w:" + width + " h:" + height + " pixelSize:" + pixelSize + " formatStr:" + pixelFormatString);

        builder.AppendLine("Current ErrCode: " + PluginFunctions.arwGetError());


        using (AndroidJavaClass cls_UnityPlayer = new AndroidJavaClass("com.google.unity.UnityTangoARPlayer"))
        {
            JLog(cls_UnityPlayer.ToString());
            cls_UnityPlayer.CallStatic("foo");
//			using (AndroidJavaObject obj_Activity = cls_UnityPlayer.GetStatic<AndroidJavaObject>("currentActivity"))
//			{
//				obj_Activity .CallStatic("foo");
//			}
        }
        builder.AppendLine("I Called UnityTangoARPlayer.foo()");

        debugAndToast(builder.ToString());
    }
コード例 #2
0
ファイル: ARManager.cs プロジェクト: 777CC/SmartlabAR
    IEnumerator Load(CanvasGroup landingPageCG)
    {
        int loadingCount = 0;

        LoadingText.text = "0%";
        if (arMarkers.Length > 0)
        {
            foreach (ARMarker marker in arMarkers)
            {
                if (!marker.isActiveAndEnabled)
                {
                    marker.enabled = true;
                }
                loadingCount++;
                LoadingText.text = ((loadingCount * 100) / (arMarkers.Length + 1)).ToString() + "%";
                yield return(new WaitForSeconds(0.7f));
            }
        }

        Debug.Log(arController.enabled + " : " + !arController.IsRunning);
        //yield return new WaitForSeconds(5);
        if (!arController.enabled)
        {
            arController.enabled = true;
        }
        else
        {
            if (!arController.IsRunning)
            {
                arController.StartAR();
            }
        }

        MarkerTagToVideo = new Dictionary <string, string>();
        MarkerTagToVideo.Add("1-A", "SmartLab02");
        MarkerTagToVideo.Add("1-B", "SmartLab02");
        MarkerTagToVideo.Add("2-A", "SmartLab08");
        MarkerTagToVideo.Add("2-B", "SmartLab08");
        MarkerTagToVideo.Add("3-A", "SmartLab07");
        MarkerTagToVideo.Add("3-B", "SmartLab07");
        MarkerTagToVideo.Add("4-A", "SmartLab01");
        MarkerTagToVideo.Add("4-B", "SmartLab01");
        MarkerTagToVideo.Add("5-A", "SmartLab03");
        MarkerTagToVideo.Add("5-B", "SmartLab03");
        MarkerTagToVideo.Add("6-A", "SmartLab05");
        MarkerTagToVideo.Add("6-B", "SmartLab05");
        MarkerTagToVideo.Add("7-A", "SmartLab04");
        MarkerTagToVideo.Add("7-B", "SmartLab04");
        MarkerTagToVideo.Add("8-A", "SmartLab06");
        MarkerTagToVideo.Add("8-B", "SmartLab06");
        MarkerTagToVideo.Add("8-C", "SmartLab06");



        //Destroy(LoadingPanel);
        //yield return new WaitUntil(() => arController.IsRunning);PluginFunctions.arwIsRunning()

        yield return(new WaitUntil(() => PluginFunctions.arwIsRunning()));

        LoadingText.text = "100%";
        yield return(new WaitForSeconds(0.4f));

        LoadingPanel.SetActive(false);
        landingPageCG.alpha = 0;
        //yield return new WaitForSeconds(0.01f);
    }