public async void OnShoot()
    {
        for (int i = 0; i < UIObjects.Length; i++)
        {
            UIObjects[i].SetActive(false);
        }
        SmileProject.Instance.PlaySe("flash");

        Texture2D tex = null;


        if (camAvailable)
        {
            tex = ImitateUtil.Orient(backCam, backCam.videoRotationAngle, m_is_front);
            //tex = WebCamUtil.TakePictureFromCamera (SmileProject.Instance.Camera);
        }
        else
        {
            tex = DefaultPic;
        }

        m_loading             = true;
        loading_tiper.enabled = true;

        if (backCam != null)
        {
            backCam.Pause();
        }
        //SmileProject.Instance.LutifyComp.Blend = 0;


        var result = await HandleBase64Image(WebCamUtil.TextureToBase64(tex), tex);


        var resultPage = SimplePageManager.Instance.Show("SmileResultPage") as SmileResultPage;

        resultPage.SetInfo(MakeScore(result[0].emotion), tex, result[0].emotion);

        //logBuilder.Clear ();
        //for (int i = 0; i < result[0].emotion.Count; i++) {
        //    logBuilder.Append (EmotionSDK.GetEmotionTypeNameByIndex (i));
        //    logBuilder.Append ( ": " );
        //    logBuilder.AppendLine (result[0].emotion[i].ToString ());
        //}
        //Debug.Log (logBuilder.ToString ());
    }
Exemple #2
0
    private void Shot()
    {
        Texture2D input;

        if (Application.platform != RuntimePlatform.OSXEditor)
        {
            var t       = this.RawImage_moniter.texture as WebCamTexture;
            var texture = ImitateUtil.Orient(t, t.videoRotationAngle, this.isFronCamera);
            // 预览修正后的贴图
            RawImage_fixed.texture = texture;
            input = texture;
        }
        else
        {
            // 如果是测试模式,使用源图片作为输入图片
            input = ImitateManager.origin;
        }
        ImitateManager.input = input;
        var page = UIEngine.Forward <ImitateResultPage>();

        page.SetImage(input);
        page.PlayFlash();
    }