美文网首页Unity技术VR/AR分享
Unity+Vuforia ar 摄像机自动对焦

Unity+Vuforia ar 摄像机自动对焦

作者: 树上的cat_ee3c | 来源:发表于2017-09-27 23:27 被阅读20次

    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 摄像机自动对焦

        本文链接:https://www.haomeiwen.com/subject/olipextx.html