public void SetImportMovie(string folder, string filename) { if (Live) { StopLiveTracking(); } if (!FacePlus.IsInitStarted) { Logger.Info("FacePlus initializing (video)..."); FacePlus.Init("VGA"); float startTime = Time.time; StartCoroutine(FacePlus.AfterInit((success) => { float timePassed = Time.time - startTime; Logger.Log("FacePlus initialized (success: " + success + ") in " + timePassed + "s"); Logger.Log("Setting import movie from " + folder + "/" + filename); StartCoroutine(SetImportMovieCoroutine(folder, filename)); })); } else { Logger.Log("Setting import movie from " + folder + "/" + filename); StartCoroutine(SetImportMovieCoroutine(folder, filename)); } }
public void StartLiveTracking() { //Debug.Log ("Start Live Tracking"); Logger.Log("FacePlus connectivity: " + (FacePlus.Echo(123) == 123 ? "Pass" : "FAIL")); Logger.Log("FacePlus initializing..."); //Logger.Log ("Initializing with: " + "VGA@CAM" + FacePlus.DeviceID.ToString ()); FacePlus.Init("VGA@CAM" + FacePlus.DeviceID.ToString()); Live = true; float startTime = Time.time; StartCoroutine(FacePlus.AfterInit((bool success) => { float timePassed = Time.time - startTime; Logger.Info("FacePlus completed initialization."); Logger.Log("FacePlus initialized (success: " + success + ") in " + timePassed + "s"); if (success) { Live = true; state = CaptureState.Live; Logger.Debug("starting tracking thread"); FacePlus.TrackForeverThreaded(); Logger.Debug("done starting tracking thread"); } else { Live = false; } })); }