Vuforia学习之自动对焦

作者: HoyaWhite | 来源:发表于2016-07-13 16:12 被阅读724次
    1. 新建C#脚本
    2. 把脚本拖给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);  
            }  
        }  
    }  
    
    自动对焦脚本

    脚本参考链接

    相关文章

      网友评论

        本文标题:Vuforia学习之自动对焦

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