Unity+Vuforia ar 摄像机自动对焦

using System.Collections;

using System.Collections.Generic;

using UnityEngine;

using Vuforia;

public class AutoCameraDevice : MonoBehaviour {

void Start()

{

CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);

}

void Update()

{

//自动对焦

//if (m_bIsFocus)

#if UNITY_EDITOR

if (Input.GetMouseButtonUp(0))

#elif UNITY_ANDROID || UNITY_IPHONE

if (Input.touchCount > 0 && Input.GetTouch(0).phase == TouchPhase.Began)

#endif

{

CameraDevice.Instance.SetFocusMode(CameraDevice.FocusMode.FOCUS_MODE_CONTINUOUSAUTO);

}

}

}

转自:http://blog.csdn.net/zhaokuo_123456/article/details/61914722

你可能感兴趣的:(Unity+Vuforia ar 摄像机自动对焦)