Unity技术VR/AR分享

Unity+Vuforia ar 摄像机自动对焦

2017-09-27  本文已影响20人  树上的cat_ee3c

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

上一篇下一篇

猜你喜欢

热点阅读