Vuforia学习之自动对焦
2016-07-13 本文已影响724人
HoyaWhite
- 新建C#脚本
- 把脚本拖给ARCamera
using UnityEngine;
using System.Collections;
public class ARCameraAutomic : MonoBehaviour
{
// Use this for initialization
void Start()
{
Vuforia.CameraDevice.Instance.SetFocusMode(Vuforia.CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
}
// Update is called once per frame
void Update()
{
#if UNITY_EDITOR
if(Input.GetMouseButtonUp(0))
#elif UNITY_ANDROID || UNITY_IPHONE
if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)
#endif
{
Vuforia.CameraDevice.Instance.SetFocusMode(Vuforia.CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);
}
}
}
自动对焦脚本