예제 #1
0
        private void Run()
        {
            Debug.Log("Run");
            live2DModel.textureFiles = new Texture2D[texture_filepath.Length];
            for (int i = 0; i < texture_filepath.Length; i++)
            {
                if (string.IsNullOrEmpty(texture_filepath [i]))
                {
                    continue;
                }

                Texture2D tex = new Texture2D(2, 2);
                tex.LoadImage(File.ReadAllBytes(texture_filepath [i]));
                live2DModel.textureFiles [i] = tex;
            }
            if (!string.IsNullOrEmpty(shizuku_moc_filepath))
            {
                live2DModel.setMocFileFromBytes(File.ReadAllBytes(shizuku_moc_filepath));
            }
            if (!string.IsNullOrEmpty(shizuku_physics_filepath))
            {
                live2DModel.setPhysicsFileFromBytes(File.ReadAllBytes(shizuku_physics_filepath));
            }
            if (!string.IsNullOrEmpty(shizuku_pose_filepath))
            {
                live2DModel.setPoseFileFromBytes(File.ReadAllBytes(shizuku_pose_filepath));
            }


            faceLandmarkDetector = new FaceLandmarkDetector(shape_predictor_68_face_landmarks_dat_filepath);
            frontalFaceParam     = new FrontalFaceParam();

            webCamTextureToMatHelper.Init();
        }
예제 #2
0
        private void Run()
        {
            Debug.Log("Run");

            faceLandmarkDetector = new FaceLandmarkDetector(shape_predictor_68_face_landmarks_dat_filepath);
            frontalFaceParam     = new FrontalFaceParam();

            // Use the front camera to Init
            webCamTextureToMatHelper.Init(null, webCamTextureToMatHelper.requestWidth, webCamTextureToMatHelper.requestHeight, !webCamTextureToMatHelper.requestIsFrontFacing);

            //// Default initialization
            //webCamTextureToMatHelper.Init();
            //webCamTextureToMatHelper.Init(null, 320, 240, false);
        }
 // Use this for initialization
 void Start()
 {
     webCamTextureToMatHelper = gameObject.GetComponent <WebCamTextureToMatHelper>();
     webCamTextureToMatHelper.Init();
 }
 public void OnChangeCameraButton()
 {
     webCamTextureToMatHelper.Init(null, webCamTextureToMatHelper.requestWidth, webCamTextureToMatHelper.requestHeight, !webCamTextureToMatHelper.requestIsFrontFacing);
 }