Exemplo n.º 1
0
    public IEnumerator ShowCroppedFaces()
    {
        croppedFaceDatas = CroppedFaceData.LoadData(faceDataFile);
        if (croppedFaceDatas != null)
        {
            foreach (CroppedFaceData c in croppedFaceDatas)
            {
                GameObject            g   = Instantiate(facePrefab, croppedFaceContainer.transform);
                Image                 img = g.GetComponent <Image>();
                CroppedFaceProperties cfp = g.GetComponent <CroppedFaceProperties>();
                cfp.imageName  = c.imageName;
                cfp.imageIndex = croppedFaceDatas.IndexOf(c);

                cfp.InitFaceProperties(c);


                faces.Add(g);
                print(string.Format("loading image : {0}", c.imageName));
                StartCoroutine(LoadImageFromDisk(img, c.imageName));
            }
        }


        Invoke("HideLoadingPanelOnly", .1f);
        yield return(null);
    }
 public void Copy(ref CroppedFaceProperties cp)
 {
     cp = new CroppedFaceProperties
     {
         imageName     = this.imageName,
         imageIndex    = this.imageIndex,
         dataPath      = this.dataPath,
         finalSavePath = this.finalSavePath,
         faceHash      = this.faceHash
     };
     cfd.Copy(ref cp.cfd);
 }