I am working on an app for android. I use the Handheld.PlayFullScreenMovie which pauses the app to play the video. However when the app returns the camera will no longer auto-focus.
I am using this script on my camera.
using UnityEngine;
using System.Collections;
public class Autofocus : MonoBehaviour {
private bool EnableAutofocus = false;
// Use this for initialization
void Start() {
EnableAutofocus = true;
}
// Update is called once per frame
void Update () {
if (EnableAutofocus) {
bool success = CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
if (success) {
Debug.Log("Successfully set the continuous autofocus");
}
else {
Debug.Log("Unable to set the continuous autofocus");
}
EnableAutofocus = false;
}
}
}
After pausing the camera runs however the script does not seem to reload.
How do I make sure this script runs when the app starts up again?
I am also using the vuforia sdk if that matters?